1 00:00:00,000 --> 00:00:01,660 And it's now the top of the hour. 2 00:00:01,660 --> 00:00:03,560 It is 4 o'clock p.m. 3 00:00:03,560 --> 00:00:06,040 in Las Vegas at DEF CON 33. 4 00:00:06,040 --> 00:00:06,700 Welcome. 5 00:00:07,400 --> 00:00:16,720 And it's my honor to introduce to you the speaker and a partner in crime, Ryan Mitchell, to talk about SSH Honeypots. 6 00:00:20,360 --> 00:00:21,780 All right. 7 00:00:22,480 --> 00:00:23,460 Hi. 8 00:00:23,480 --> 00:00:33,880 So I'm Ryan Mitchell, and I'm here to talk about my two favorite things, besides, I guess, my family, which is SSH Honeypots and walkthrough workshops at the Hacking Village. 9 00:00:34,040 --> 00:00:44,080 So I realized that the word honeypot could refer to a great many things here at DEF CON, but for the purposes of this talk, unless specified otherwise, honeypot refers to an SSH honeypot. 10 00:00:44,540 --> 00:00:46,500 So a little bit about me. 11 00:00:46,500 --> 00:00:48,940 I'm not a networking or an IT person. 12 00:00:48,940 --> 00:00:55,560 I'm a software engineer, and I've done this, nothing else, nothing but software engineering basically my whole career, including high school jobs. 13 00:00:55,560 --> 00:01:01,580 So I have a vague sense of what packets are, but I like to joke that I have people to handle those for me. 14 00:01:01,880 --> 00:01:07,540 And this is relevant for the talk, so that's the perspective I'm coming at this with. 15 00:01:07,600 --> 00:01:11,400 I also use the handle Klugeist at the Packet Hacking Village. 16 00:01:11,420 --> 00:01:13,240 So go up there, ask for Klugeist. 17 00:01:13,240 --> 00:01:15,160 They may not know who Ryan is. 18 00:01:16,140 --> 00:01:18,660 So my work doesn't pay me to be here. 19 00:01:18,660 --> 00:01:20,640 I've been doing this for fun for a long time. 20 00:01:20,640 --> 00:01:23,380 I just buy my own tickets, take vacation from work. 21 00:01:23,440 --> 00:01:28,640 So I do want to take this opportunity for tax purposes to talk about two of my books. 22 00:01:28,640 --> 00:01:32,360 This is officially a promotional tour that I'm doing. 23 00:01:32,680 --> 00:01:35,920 So Unlocking Python and Web Scraping with Python. 24 00:01:36,120 --> 00:01:43,180 So Unlocking Python was released last spring, and it teaches Python from sort of CS foundations and programming culture. 25 00:01:43,300 --> 00:01:49,960 So I start with the history of C and Unix and go into information theory, how computers operate in memory. 26 00:01:49,980 --> 00:01:54,000 And then I do, then, after I've covered that, I do a Hello World. 27 00:01:54,840 --> 00:01:59,460 So it also ends with some chapters on some of the most well-known Python frameworks out there. 28 00:01:59,460 --> 00:02:01,840 So Flask, Django, Scrapy, Scikit-learn. 29 00:02:01,880 --> 00:02:04,820 It's kind of the Python book that I always wanted to exist. 30 00:02:04,820 --> 00:02:08,960 So if you're looking to learn Python or know someone who is, you might consider it. 31 00:02:09,080 --> 00:02:14,920 And I've also logged as many copies as I could, as Worlard saw, in my suitcase. 32 00:02:14,920 --> 00:02:16,400 It weighed about 100 pounds. 33 00:02:17,000 --> 00:02:20,140 So I will tell you how to win one for free later on. 34 00:02:21,280 --> 00:02:23,980 So Web Scraping with Python, pretty self-explanatory. 35 00:02:23,980 --> 00:02:26,640 The book just had its 10-year anniversary, which is pretty cool. 36 00:02:26,640 --> 00:02:28,220 And it's now in its third edition. 37 00:02:29,860 --> 00:02:35,300 And I also do LinkedIn learning courses, including the most popular Python course, which is Python Essential Training. 38 00:02:35,900 --> 00:02:42,900 So LinkedIn is a great resource for all sorts of things, especially if you're interested in Python or Django or data structures. 39 00:02:43,400 --> 00:02:46,260 Actually, data structures are probably my third favorite thing. 40 00:02:47,040 --> 00:02:47,580 All right. 41 00:02:47,580 --> 00:02:48,940 So thank you for your patience. 42 00:02:48,940 --> 00:02:50,980 That's the end of the mandatory IRS section. 43 00:02:50,980 --> 00:03:01,880 Now, on to the first part of this talk is going to be about sort of the history, my involvement with the Packet Hacking Village, PHV, and how I got there. 44 00:03:02,280 --> 00:03:06,300 How I became interested in SSH honeypots and why you should be, too. 45 00:03:06,540 --> 00:03:11,440 And then we're going to talk about the walkthrough workshops, sort of how they came about, how you can get involved in those. 46 00:03:11,540 --> 00:03:18,320 And then finally, we're going to talk about hacking cowry, cowry honeypots, but probably not in the way that you think. 47 00:03:19,700 --> 00:03:25,960 So for four glorious years, I enjoyed DEF CON like many of you here are doing. 48 00:03:26,040 --> 00:03:27,100 I walked around. 49 00:03:27,100 --> 00:03:28,180 I met new people. 50 00:03:28,180 --> 00:03:29,540 I saw things. 51 00:03:29,540 --> 00:03:31,460 I went from village to village. 52 00:03:31,680 --> 00:03:33,080 I went to parties. 53 00:03:33,080 --> 00:03:34,360 It was fantastic. 54 00:03:34,360 --> 00:03:42,680 Then in 2016, I was speaking at a conference in Texas with Daven Potts, also known as BSE and the PHV. 55 00:03:42,680 --> 00:03:44,120 There's a lot of acronyms. 56 00:03:44,480 --> 00:03:46,720 He actually runs the wall of sheep. 57 00:03:46,720 --> 00:03:48,780 So really cool guy. 58 00:03:49,480 --> 00:03:53,360 He runs the literal wall, I mean, like the things on the projector. 59 00:03:53,640 --> 00:04:04,060 So we were talking afterwards about DEF CON and he suggested that I give a talk at the packet hacking village about the intersection of web scraping and packet hacking. 60 00:04:04,740 --> 00:04:09,120 Which, I mean, it was a bonkers talk. 61 00:04:09,120 --> 00:04:20,060 There were a lot of illustrations and diagrams and ranting, but it was pretty well received and I had a blast and met everyone at the packet hacking village and it was a lot of fun. 62 00:04:20,760 --> 00:04:23,940 And that was the last time I ever ventured outside of the packet hacking village. 63 00:04:23,940 --> 00:04:26,220 I have been trapped there ever since. 64 00:04:26,220 --> 00:04:30,780 I have no idea what has happened in DEF CON in the last nine years. 65 00:04:30,800 --> 00:04:32,920 So this is my life now. 66 00:04:35,100 --> 00:04:41,720 So also in 2016, after my talk, I was hanging out at the PHV and I saw this strange entry on the wall of sheep. 67 00:04:42,120 --> 00:04:46,740 It was an IP address and it had its protocol listed as SSH. 68 00:04:46,740 --> 00:04:48,080 The user name was root. 69 00:04:48,080 --> 00:04:53,220 Now, the SSH protocol, by definition, does not go on the wall of sheep. 70 00:04:53,680 --> 00:04:55,100 It's a secure protocol. 71 00:04:55,100 --> 00:04:56,100 It shouldn't be there. 72 00:04:56,100 --> 00:04:58,060 So that was pretty weird. 73 00:04:58,320 --> 00:05:02,740 The password was obfuscated, but I think it was eight characters and started with P. 74 00:05:02,740 --> 00:05:14,240 So I logged in, hacked it, if you will, and I'm poking around the server and there's a little text file in the home directory, but that's not important right now. 75 00:05:14,240 --> 00:05:17,420 What's important is that I am root on some random server. 76 00:05:17,460 --> 00:05:18,440 Amazing. 77 00:05:19,340 --> 00:05:21,300 The base 64 file can wait. 78 00:05:21,300 --> 00:05:22,520 I do not care. 79 00:05:22,520 --> 00:05:25,800 The mystery text file had some base 64 garbage in it. 80 00:05:27,320 --> 00:05:35,840 I was poking around, looking at listing files, realized that it didn't have VI, which is fine. 81 00:05:35,840 --> 00:05:39,580 It also didn't have Emacs or nano or basically anything. 82 00:05:41,500 --> 00:05:49,540 I would poke at some files, see some files while listing it and then I would cat them and they didn't exist. 83 00:05:49,540 --> 00:05:51,860 It told me no such file. 84 00:05:52,180 --> 00:05:54,120 So that was bizarre. 85 00:05:54,960 --> 00:06:01,220 Now, all of you here are pretty smart and you've probably figured out already that I was in a honeypot. 86 00:06:01,460 --> 00:06:04,460 I figured this out eventually. 87 00:06:04,860 --> 00:06:09,440 I had never seen a honeypot before and it blew my mind. 88 00:06:09,440 --> 00:06:10,820 So I was nowhere near bash. 89 00:06:10,820 --> 00:06:12,480 I was not root at all. 90 00:06:12,480 --> 00:06:20,300 I was exchanging messages with a Python program that was sending strings back to me that looked like a bash prompt. 91 00:06:20,980 --> 00:06:28,500 To add insult to injury, this whole Python program was running under a low level user in a docker container. 92 00:06:28,740 --> 00:06:31,880 So never got anywhere near anything. 93 00:06:33,000 --> 00:06:41,080 So once I figured this out, I stopped getting distracted by the whole I am root thing and I started playing around with the challenge they had, that file in the root directory. 94 00:06:41,380 --> 00:06:48,200 So decoding the base 64 file gave me the credentials for another server and that server had a steganography challenge. 95 00:06:48,320 --> 00:06:51,360 Solving that gave me the credentials for a third server and so on. 96 00:06:52,240 --> 00:06:55,220 So I don't remember the challenges, the rest of the exact challenges. 97 00:06:55,220 --> 00:07:01,300 So this is the first honeypot and it's unfortunately run by someone who is sort of a persona non grata with a PHV these days. 98 00:07:01,300 --> 00:07:04,120 So I was not able to consult him for this talk. 99 00:07:04,160 --> 00:07:06,100 But it was very fun. 100 00:07:06,100 --> 00:07:07,540 I do remember that. 101 00:07:07,540 --> 00:07:13,160 Ton of fun little single page CS challenges and it was just a blast to do. 102 00:07:13,460 --> 00:07:15,040 Finally I got to the end. 103 00:07:15,200 --> 00:07:18,380 I told them the secret pass phrase and they were very excited. 104 00:07:18,380 --> 00:07:22,600 I was the first winner that weekend and actually I was the only winner. 105 00:07:22,600 --> 00:07:26,180 I was the only one who went through the honeypot and bothered to do that. 106 00:07:26,620 --> 00:07:31,860 So they ran around, put together a little prize bag, I got some t-shirts and it was just fantastic. 107 00:07:32,600 --> 00:07:36,380 So let's back up a little bit and talk about what this thing actually is. 108 00:07:36,380 --> 00:07:39,380 What are SSH honeypots and what is cowry? 109 00:07:39,680 --> 00:07:49,520 So an SSH honeypot is a program that is running on a server that often but not always purports to be different software than it actually is. 110 00:07:49,520 --> 00:07:59,020 So this thing says that it's bash or it might say that it's SQL or it might say, you know, whatever. 111 00:07:59,060 --> 00:08:04,300 But it's actually just a program that's sending you lines back to make it look like this thing. 112 00:08:05,080 --> 00:08:11,640 The most basic descriptor of a honeypot is whether it is low interaction, medium interaction or high interaction. 113 00:08:11,840 --> 00:08:19,000 So the low interaction honeypots typically support a wide variety of protocols but you can't really do anything with them. 114 00:08:19,840 --> 00:08:29,060 So supports SMB, FTP, HTTP, MySQL, TFTP, like all sorts of stuff. 115 00:08:29,740 --> 00:08:33,880 But basically you get a banner, you get the handshake, that's it. 116 00:08:33,880 --> 00:08:45,140 So if someone wants something with some actual interaction, maybe you want to look at how bad actors are acting inside a honeypot, you might want something like cowry. 117 00:08:46,020 --> 00:08:48,200 It only supports telnet and SSH. 118 00:08:48,200 --> 00:08:52,720 It's considered medium interaction but it does support a lot of bash commands. 119 00:08:53,280 --> 00:08:56,700 They also keep track of the files that are supposed to be on the server. 120 00:08:56,700 --> 00:08:58,940 So you can connect them to actual files. 121 00:08:58,940 --> 00:09:01,280 There's a file structure inside of it. 122 00:09:01,840 --> 00:09:05,260 So you can list the directory, you can cat and tell files. 123 00:09:05,260 --> 00:09:07,280 There are things to look at and interact with. 124 00:09:07,520 --> 00:09:13,260 So as you heard from my experience earlier though, it doesn't stand up to that much scrutiny. 125 00:09:13,680 --> 00:09:20,560 When someone talks about high interaction honeypots, typically they mean something with a real operating system at some level. 126 00:09:20,560 --> 00:09:25,400 You may surround it with a whole bunch of application stuff for monitoring and protection. 127 00:09:26,240 --> 00:09:28,680 And it's obviously going to be like a throwaway container. 128 00:09:28,800 --> 00:09:35,660 But it is probably going to be a real operating system that they are actually operating or interacting with at some point. 129 00:09:35,660 --> 00:09:37,220 It's going to be fundamentally real. 130 00:09:38,080 --> 00:09:40,740 There are a lot of honeypot options out there. 131 00:09:40,980 --> 00:09:43,700 I quickly became obsessed with cowry. 132 00:09:43,700 --> 00:09:48,480 It has a lot of really nice out of the box configuration features, excellent documentation. 133 00:09:49,380 --> 00:09:54,260 It's very useful for our purposes in the coming years in the packet hacking village. 134 00:09:54,260 --> 00:09:56,400 We use it for a lot of things. 135 00:09:57,380 --> 00:10:01,840 So 2018, we want to talk about the walkthrough workshops. 136 00:10:01,920 --> 00:10:10,080 2018, Riverside, the fearless leader of the packet hacking village, he wanted to introduce a new area called walkthrough workshops. 137 00:10:10,080 --> 00:10:13,620 And he said, Ryan, you should do cowry honeypots for the walkthrough workshops. 138 00:10:13,620 --> 00:10:14,860 You like honeypots. 139 00:10:15,280 --> 00:10:18,860 So teach people how to set these up and do something with them. 140 00:10:19,240 --> 00:10:24,600 And he teamed me up with Warlord, sitting in the front row there, and Catalyst to do this. 141 00:10:24,980 --> 00:10:30,100 Warlord, as you might suspect from the name, is in fact an IT director. 142 00:10:30,360 --> 00:10:33,800 And Catalyst is a very experienced network engineer. 143 00:10:33,940 --> 00:10:36,640 So Riverside really put together the A team with this one. 144 00:10:36,640 --> 00:10:41,300 I was on the keyboards and, you know, we were a band. 145 00:10:41,300 --> 00:10:45,180 It was fantastic to work with this team developing the walkthrough workshops. 146 00:10:49,580 --> 00:10:57,220 So, yeah, the first year, 2018, we got this tiny little area, sort of a little corner next to the DJ speakers. 147 00:10:57,220 --> 00:11:00,400 So it was loud and I had to shout over them a lot. 148 00:11:00,500 --> 00:11:05,400 We had ten chairs, ten laptops, a projector that was balanced on boxes or something. 149 00:11:05,900 --> 00:11:08,440 It was janky. 150 00:11:09,220 --> 00:11:17,820 So we wrote this fantastic step by step guide to installing Kauri, configuring SSH, adding fake files to the honeypot. 151 00:11:18,940 --> 00:11:20,560 We could modify the users. 152 00:11:20,560 --> 00:11:25,800 We showed people how to do all this stuff and how to build their sort of like realistic honeypot system. 153 00:11:26,140 --> 00:11:28,380 The tests went fantastically. 154 00:11:28,460 --> 00:11:31,380 We ran through the workshop over and over and over again. 155 00:11:31,380 --> 00:11:32,100 It was great. 156 00:11:32,100 --> 00:11:33,660 We tested it on site. 157 00:11:33,700 --> 00:11:34,400 Fantastic. 158 00:11:34,400 --> 00:11:36,060 Nothing could possibly go wrong. 159 00:11:36,160 --> 00:11:38,920 So on Friday, the doors to the village opened. 160 00:11:39,560 --> 00:11:47,580 And what happened around that time, as it often does, as it's happening right before I actually came into this talk, the DEF CON network goes down. 161 00:11:47,940 --> 00:11:54,880 And our very first users sit down in their chairs and they look at this lovely prepared PDF that we had slaved away on. 162 00:11:54,920 --> 00:11:57,380 And the first command was that. 163 00:11:57,920 --> 00:12:00,540 And did nothing. 164 00:12:00,820 --> 00:12:03,760 And then, you know, the network was kind of intermittent for a while. 165 00:12:03,760 --> 00:12:10,200 So basically the very first walkthrough workshop was people watching a pseudo apt get update. 166 00:12:11,100 --> 00:12:12,820 So we closed the doors. 167 00:12:12,820 --> 00:12:14,440 We went back to the drawing board. 168 00:12:14,560 --> 00:12:16,000 We built some infrastructure. 169 00:12:16,000 --> 00:12:18,320 We made Docker images that had Cowery preinstalled. 170 00:12:18,320 --> 00:12:19,380 We edited the PDFs. 171 00:12:19,380 --> 00:12:21,920 We trimmed out anything that needed to go out to the internet. 172 00:12:22,880 --> 00:12:24,480 We were ready to go again. 173 00:12:24,480 --> 00:12:27,720 So every hour on the hour, we refreshed the Docker images. 174 00:12:27,720 --> 00:12:28,800 We'd queue up people. 175 00:12:28,800 --> 00:12:30,860 All the seats were filled every hour. 176 00:12:31,380 --> 00:12:32,200 People loved it. 177 00:12:32,200 --> 00:12:33,380 They told their friends about it. 178 00:12:33,380 --> 00:12:34,920 We had to turn a bunch of people away. 179 00:12:34,920 --> 00:12:36,220 It was awesome. 180 00:12:37,060 --> 00:12:39,680 So 2019, we get more seats. 181 00:12:39,680 --> 00:12:40,880 We grew a little bit every year. 182 00:12:40,880 --> 00:12:46,560 We streamlined the workshop even more, clarified the directions, added things, removed things. 183 00:12:47,440 --> 00:12:51,220 We had special instructions on the side for people who had never used Linux before. 184 00:12:51,220 --> 00:12:54,000 So how to enter a command, how to copy paste. 185 00:12:54,260 --> 00:12:56,680 A lot of things that people needed help with. 186 00:12:56,920 --> 00:13:02,660 So the word doc got turned into a nice HTML page that people could use more easily. 187 00:13:03,060 --> 00:13:11,800 We had very, very, very clear instructions for adding files, adding users, working with the logging and Cowery replaying logs. 188 00:13:12,260 --> 00:13:14,520 Again, every seat was full every single time. 189 00:13:14,520 --> 00:13:16,440 There was huge demand for the walkthrough workshops. 190 00:13:16,440 --> 00:13:23,300 And for the next three years, DEF CON, the next three years of DEF CON, we run the workshops. 191 00:13:23,360 --> 00:13:25,660 It gets a little bit bigger every year. 192 00:13:26,840 --> 00:13:29,420 2022, we finally get our shit together. 193 00:13:29,420 --> 00:13:34,940 And we're like, isn't it weird that there's only one workshop in the walkthrough workshops? 194 00:13:36,060 --> 00:13:38,680 So we should probably have more than one workshop. 195 00:13:38,920 --> 00:13:40,780 So we bring some more people on board. 196 00:13:40,960 --> 00:13:42,920 Kraken built a password lab. 197 00:13:42,920 --> 00:13:44,180 So password cracking. 198 00:13:44,340 --> 00:13:48,640 Catalyst splits off and does a network OS walkthrough. 199 00:13:48,640 --> 00:13:53,520 And then we bring in someone named Bonus who does a build your own bot network. 200 00:13:53,800 --> 00:13:56,220 So attacking botnets against each other. 201 00:13:57,720 --> 00:13:59,140 This is a few years ago. 202 00:13:59,140 --> 00:14:00,660 I think in 2022. 203 00:14:02,000 --> 00:14:04,540 I did get their permission for these photos as well. 204 00:14:04,540 --> 00:14:07,440 So that's why they're like staring awkwardly at the camera there. 205 00:14:07,600 --> 00:14:08,820 This is just today. 206 00:14:08,820 --> 00:14:11,860 So we have more than 50 machines. 207 00:14:11,860 --> 00:14:15,180 All the workshops cycle continuously now rather than refreshing on the hour. 208 00:14:15,180 --> 00:14:17,000 So we can get a lot of people through. 209 00:14:18,140 --> 00:14:21,660 We have staff for crowd control, managing the lines. 210 00:14:21,660 --> 00:14:23,720 There's like a ticketing system to get in. 211 00:14:23,720 --> 00:14:24,600 It's pretty cool. 212 00:14:24,600 --> 00:14:25,700 People love it. 213 00:14:26,800 --> 00:14:32,040 So how do you make a workshop that appeals to all people? 214 00:14:32,400 --> 00:14:35,660 Because there are a wide variety of people at DEF CON. 215 00:14:35,900 --> 00:14:37,880 Some who are into biohacking. 216 00:14:37,880 --> 00:14:40,220 Some who are into software engineering like me. 217 00:14:40,220 --> 00:14:43,180 Some who only work with Ethernet. 218 00:14:44,700 --> 00:14:47,000 You know, it's not about how skilled they are. 219 00:14:47,000 --> 00:14:48,240 It's about what they're skilled in. 220 00:14:48,240 --> 00:14:52,660 So how do you make sure that everyone can sort of get something out of this? 221 00:14:52,680 --> 00:14:56,400 You teach something that's very specific and very niche. 222 00:14:56,400 --> 00:14:59,740 But you teach it in a very simple step by step way. 223 00:14:59,940 --> 00:15:07,060 So people who have no Linux or command line experience can learn a lot from this workshop and be able to get through it just fine. 224 00:15:07,060 --> 00:15:10,120 They learn something about interacting with the terminal. 225 00:15:10,380 --> 00:15:19,880 So people who are great at Linux and have a strong background in security and programming are also probably going to learn a lot from this workshop about using Cowery and managing it. 226 00:15:20,600 --> 00:15:25,340 Configuring a Cowery instance and why they might want to use the system at home or at work. 227 00:15:25,520 --> 00:15:31,020 So in order to do this, you really have to give exact copy paste commands for every step. 228 00:15:31,960 --> 00:15:41,280 So at one point, we even gave everyone their own unique username password for their Cowery server and we actually dynamically generated that password. 229 00:15:41,280 --> 00:15:48,720 We dynamically generated the HTML document that they were working off of so that we didn't even have like your password here. 230 00:15:48,720 --> 00:15:57,120 We put the actual password in there so that they could literally copy paste everything because you know people are going to copy your password here and put it in as their password. 231 00:15:59,080 --> 00:16:07,640 So the other thing is security might not be a big deal and I realize I'm saying this at DEF CON. 232 00:16:07,820 --> 00:16:13,420 What I mean by that is I think people get really paranoid about DEF CON sometimes. 233 00:16:14,200 --> 00:16:19,060 When we started, we had all these ideas about how to keep the physical machines secure. 234 00:16:19,060 --> 00:16:24,640 How to keep people from maliciously attacking their neighbor's honey pot and ruining the experience for other people. 235 00:16:25,300 --> 00:16:36,300 We had ideas about monitoring the screens and maybe we could have a central command console behind the NR zone so that we could see what everyone was doing all the time. 236 00:16:37,180 --> 00:16:41,040 Interestingly, it's never really been a problem. 237 00:16:41,140 --> 00:16:42,400 People want to learn. 238 00:16:42,400 --> 00:16:46,840 We have me and a lot of other staff and volunteers circulating watching the computers. 239 00:16:47,000 --> 00:16:49,880 People just really haven't tried to pull anything. 240 00:16:50,000 --> 00:16:52,440 So I'm not saying ignore security. 241 00:16:52,480 --> 00:16:56,660 In situations like this where the stakes are low, we can reformat everything. 242 00:16:56,660 --> 00:16:58,960 Worst case it's a little bit annoying. 243 00:16:59,660 --> 00:17:04,120 Maybe stop worrying so much about hackers and focus on making things fun and cool. 244 00:17:05,620 --> 00:17:09,200 Obviously the other one is don't rely on F CON internet. 245 00:17:11,060 --> 00:17:13,480 So, 2024. 246 00:17:14,420 --> 00:17:19,520 We had been running this workshop for six years now. 247 00:17:19,820 --> 00:17:25,200 And we decided it's kind of maybe time to mix it up a little bit. 248 00:17:25,200 --> 00:17:31,240 We had this finally tuned script that anyone can go through in 20 minutes with no Linux skills. 249 00:17:32,200 --> 00:17:36,220 Maybe people kind of want something else that's not honey pots. 250 00:17:36,700 --> 00:17:42,700 So appropriately, this image is generated by AI because that's what killed the honey pot. 251 00:17:42,700 --> 00:17:44,680 You can see the coffin doesn't make any sense. 252 00:17:44,680 --> 00:17:46,360 Is the jar melting? 253 00:17:46,480 --> 00:17:47,480 I don't know. 254 00:17:47,840 --> 00:17:50,120 How does the lid go on there? 255 00:17:50,120 --> 00:17:50,980 I don't know. 256 00:17:53,880 --> 00:18:01,080 So Ming and I who introduced me put together a pack of AI and that was very well received and very popular. 257 00:18:01,080 --> 00:18:02,020 I'm running it right now. 258 00:18:02,020 --> 00:18:03,760 I was running it right before this talk. 259 00:18:04,220 --> 00:18:08,560 But I know what the people want and need. 260 00:18:09,280 --> 00:18:10,540 It's honey pots. 261 00:18:11,020 --> 00:18:12,160 So here's why. 262 00:18:12,960 --> 00:18:16,460 So remember I told you about that first honey pot challenge that I stumbled on. 263 00:18:16,460 --> 00:18:18,160 The one with the programming challenge. 264 00:18:18,440 --> 00:18:23,180 So that was kind of my first exposure to the medium of SSH honey pots. 265 00:18:23,240 --> 00:18:25,640 I realized that you can actually do a lot with these. 266 00:18:25,640 --> 00:18:30,360 I couldn't get over this concept of fake servers that you can modify everything about. 267 00:18:30,360 --> 00:18:32,080 You can break the rules of bash. 268 00:18:32,080 --> 00:18:36,100 You can turn a server into Hogwarts with like a room of requirements or something. 269 00:18:36,460 --> 00:18:42,320 At this point I started asking myself, why can't all SSH honey pots be this fun? 270 00:18:42,320 --> 00:18:48,580 Why do they just sit there boring collecting malware samples and sad little bash logs for security researchers? 271 00:18:49,400 --> 00:18:53,980 So alongside the walk through workshops, I started developing some of these ideas. 272 00:18:54,020 --> 00:19:01,060 So in 2017, I worked with a team of a few other mostly networking nerds to develop the second honey pot challenge. 273 00:19:02,180 --> 00:19:07,280 So at this time, the honey pots were all tied together with a fun story line. 274 00:19:07,280 --> 00:19:09,480 So they weren't just discrete random CS challenges. 275 00:19:09,480 --> 00:19:10,740 They had a story line. 276 00:19:11,180 --> 00:19:12,140 It was a little contrived. 277 00:19:12,140 --> 00:19:16,860 But an evil corporation has an evil plan to steal water from Lake Tahoe. 278 00:19:16,900 --> 00:19:19,580 You have to find the secret memos and give them to the FBI. 279 00:19:19,580 --> 00:19:21,000 It was all very fun. 280 00:19:22,400 --> 00:19:30,060 Throughout the whole thing on every server, you would actually get kicked off at regular intervals and be unable to log back in for a few minutes. 281 00:19:30,880 --> 00:19:38,400 If you sat down at the wall of sheep, like physically in our area, we had this image of the security guy. 282 00:19:38,980 --> 00:19:42,960 So he would take frequent and very long coffee breaks, occasionally go to sleep. 283 00:19:43,080 --> 00:19:48,960 And while he was distracted, the server was open and you could log in and mess around and do whatever you wanted and solve the challenges. 284 00:19:49,000 --> 00:19:55,540 When he looked at his computer, and we gave you a fair bit of warning, he would start to crack his eyes open or something, everyone would get kicked off. 285 00:19:55,660 --> 00:19:56,920 Then you had a ban. 286 00:19:56,920 --> 00:19:59,880 The goal was to avoid the ban and be able to use the challenge. 287 00:20:00,260 --> 00:20:01,060 That was a lot of fun. 288 00:20:01,060 --> 00:20:03,540 We had people in our area staring at the projector. 289 00:20:04,540 --> 00:20:07,380 We also had a jump box that led to another server. 290 00:20:07,780 --> 00:20:10,960 But the server's IP address changed with the clock time. 291 00:20:11,260 --> 00:20:16,040 So if it was 1130 a.m., the IP address ended with 11.30. 292 00:20:16,100 --> 00:20:19,380 If it was 245, it ended with 2.45. 293 00:20:19,820 --> 00:20:22,640 So you had one minute on the machine each day. 294 00:20:22,660 --> 00:20:25,380 So it was very annoying. 295 00:20:25,580 --> 00:20:27,320 But that was a really fun one. 296 00:20:28,660 --> 00:20:31,260 And also the fact that I'm a software engineer is relevant. 297 00:20:31,260 --> 00:20:33,840 I remember I really wanted to do this challenge. 298 00:20:33,840 --> 00:20:36,260 I had this idea of like a brigadoon server. 299 00:20:37,700 --> 00:20:42,160 And they said we can't do it because we don't have enough IP addresses. 300 00:20:42,160 --> 00:20:44,160 We don't have the IP address space. 301 00:20:44,600 --> 00:20:54,340 And I said, well, is there a way you could go through another machine and get a whole new space of IP addresses just through that machine? 302 00:20:54,820 --> 00:20:56,580 And he said, like a router? 303 00:20:56,680 --> 00:20:57,740 I was like, yeah. 304 00:20:57,860 --> 00:20:59,460 Whatever you want to call it. 305 00:21:02,260 --> 00:21:03,280 So we built it. 306 00:21:03,280 --> 00:21:04,200 It was awesome. 307 00:21:05,060 --> 00:21:08,080 So there were some more classic puzzle servers. 308 00:21:08,860 --> 00:21:11,340 JWT, token decoding, another challenge. 309 00:21:12,020 --> 00:21:16,480 Certain honey pots you had to avoid or you would end up on the firewall list for a while. 310 00:21:17,220 --> 00:21:21,040 And this year, more people besides just me did the challenge and they won. 311 00:21:21,040 --> 00:21:23,360 And we gave a lot of people fabulous t-shirt prizes. 312 00:21:23,360 --> 00:21:24,440 It was a lot of fun. 313 00:21:25,100 --> 00:21:31,720 So 2019, I did another honey pot challenge along with catalyst, the network engineer. 314 00:21:32,700 --> 00:21:35,980 And we were working together on the honey pot workshop at the time. 315 00:21:36,080 --> 00:21:40,980 We wrote down this IP address and dropped notes about it everywhere around con. 316 00:21:40,980 --> 00:21:45,100 He hung them up in the men's bathroom, I hung them up in the women's room. 317 00:21:45,280 --> 00:21:48,800 We got a lot of people playing it. 318 00:21:49,040 --> 00:21:50,940 So there were five challenges. 319 00:21:51,140 --> 00:21:58,300 And the answer to each one was lullaby, lemon drops, star, chimney tops and blue birds. 320 00:21:59,040 --> 00:22:07,240 Then the final challenge, they said, go to the hacking village, find Klugeist and name that song. 321 00:22:07,460 --> 00:22:14,760 So all of these people were coming over to me that weekend and they would just walk up to me and say, somewhere over the rainbow. 322 00:22:14,960 --> 00:22:16,040 And I would get very excited. 323 00:22:16,040 --> 00:22:17,320 I would say, you win. 324 00:22:18,120 --> 00:22:21,500 And from an outside perspective, I'm sure it looked very weird. 325 00:22:21,500 --> 00:22:23,000 But it was amazing. 326 00:22:24,080 --> 00:22:26,900 So the next honey pot challenge is 2022. 327 00:22:27,360 --> 00:22:30,300 And DEF CON had been through some weird times with the pandemic. 328 00:22:30,360 --> 00:22:32,140 And I really wanted to kick this year off right. 329 00:22:32,140 --> 00:22:36,360 So 30th anniversary of DEF CON, the theme was hacker homecoming. 330 00:22:36,540 --> 00:22:40,980 And I wanted to honor that with an old school hacker and 90s vibe. 331 00:22:41,120 --> 00:22:42,540 So my home is in Seattle. 332 00:22:42,540 --> 00:22:43,340 I grew up in Seattle. 333 00:22:43,340 --> 00:22:44,640 I'm in Boston now. 334 00:22:44,780 --> 00:22:45,620 But I grew up there. 335 00:22:45,620 --> 00:22:51,900 And if you look at the street system of Seattle, you'll see something that we don't have in Boston, which is a grid. 336 00:22:51,900 --> 00:22:53,660 The streets of Seattle aren't a grid. 337 00:22:53,660 --> 00:22:56,120 And the streets of Boston very much not. 338 00:22:56,440 --> 00:23:02,820 So I made this sort of like a colossal cave adventure-esque game based on a map of downtown Seattle. 339 00:23:03,180 --> 00:23:05,440 So you SSH into a server. 340 00:23:05,680 --> 00:23:11,600 It announces that you've woken up after being slapped in the face with an ASCII fish and a man apologizes to you. 341 00:23:11,620 --> 00:23:17,140 Now, if you know anything about Seattle, this pinpoints your location exactly. 342 00:23:17,920 --> 00:23:19,900 So you look around you. 343 00:23:19,900 --> 00:23:21,980 You see a torn up concert poster. 344 00:23:22,120 --> 00:23:23,620 The concert starts in five minutes. 345 00:23:23,620 --> 00:23:24,580 And you must be there. 346 00:23:24,580 --> 00:23:26,820 You do an LS and you see four directories. 347 00:23:26,820 --> 00:23:28,820 North, south, east, west. 348 00:23:29,100 --> 00:23:32,940 You find out that you're in Pike's Place market, obviously because of the fish. 349 00:23:33,940 --> 00:23:36,020 And the directory structure is a grid. 350 00:23:36,020 --> 00:23:41,920 So at every point in the grid, you can do a PWD and it will tell you the cross streets and optionally some landmarks around you. 351 00:23:42,140 --> 00:23:48,400 And of course, it's 1992, so every file on the server has an appropriate time stamp. 352 00:23:49,160 --> 00:23:52,380 There's a low resolution ASCII movie that gets played. 353 00:23:53,680 --> 00:23:58,240 It's a music video from Smells Like Teen Spirit, When You Win. 354 00:23:58,240 --> 00:24:00,380 So very thematic, very fun. 355 00:24:00,380 --> 00:24:02,000 The resolution on that video sucked. 356 00:24:02,000 --> 00:24:03,940 It took way too long to do. 357 00:24:04,700 --> 00:24:08,180 Trying to transmit video over SSH is not fun. 358 00:24:09,760 --> 00:24:11,320 So the second server. 359 00:24:11,480 --> 00:24:13,780 Unfortunately, I have no idea if this code exists anymore. 360 00:24:13,780 --> 00:24:15,800 I resurrected a lot of stuff for this talk. 361 00:24:15,800 --> 00:24:20,160 I could not find the server image and something else mislabeled as it. 362 00:24:20,160 --> 00:24:24,600 But there was a limerick hinting at the solution that I'm very sad to have lost. 363 00:24:24,600 --> 00:24:27,300 But everything else can be rewritten, so not too bad. 364 00:24:27,780 --> 00:24:29,260 But you have the same file grid. 365 00:24:29,260 --> 00:24:33,220 Every server in this challenge had a grid file system. 366 00:24:33,380 --> 00:24:34,600 But this time you're in a dungeon. 367 00:24:34,600 --> 00:24:38,740 Every dungeon has a torch and you can use the light command to light and extinguish torches. 368 00:24:38,920 --> 00:24:46,380 So the secret is that each torch actually toggles a cell in John Conway's Game of Life. 369 00:24:46,760 --> 00:24:48,540 And your goal is to build a glider. 370 00:24:48,540 --> 00:24:49,540 And you have to figure that out. 371 00:24:49,540 --> 00:24:50,600 Build a glider. 372 00:24:50,820 --> 00:24:53,300 You go back to the home directory. 373 00:24:53,520 --> 00:24:56,660 Run life.sh. 374 00:24:56,940 --> 00:24:58,460 And then it triggers it. 375 00:24:58,460 --> 00:25:05,340 And I wrote a cellular automaton validator in the honey pot. 376 00:25:05,360 --> 00:25:06,420 And then it checks your work. 377 00:25:06,420 --> 00:25:08,220 And then you go on to the next challenge. 378 00:25:09,740 --> 00:25:10,320 Yeah. 379 00:25:10,320 --> 00:25:11,860 There's a little glider right there. 380 00:25:13,320 --> 00:25:14,080 Okay. 381 00:25:14,080 --> 00:25:15,040 So third server. 382 00:25:15,040 --> 00:25:16,400 I do have this one. 383 00:25:16,400 --> 00:25:17,880 It's an homage to hackers. 384 00:25:17,880 --> 00:25:19,240 Now we're hacking the Gibson. 385 00:25:19,240 --> 00:25:20,200 Amazing. 386 00:25:20,840 --> 00:25:23,320 Instead of a grid, it's now a cube. 387 00:25:23,320 --> 00:25:25,820 I added random distracting corporate documents. 388 00:25:25,820 --> 00:25:28,880 It was generated by a Markov generator. 389 00:25:28,880 --> 00:25:32,780 You have this file that introduces you to the access command. 390 00:25:33,420 --> 00:25:40,020 The access command tells you which floors you have access to and which floors you need to get access to. 391 00:25:40,260 --> 00:25:48,440 So in addition to hackers, I'd be lying if I said that I wasn't also inspired by game boy Pokemon red blue. 392 00:25:49,380 --> 00:25:57,780 So as you walk around the floors, every command you run has a chance to randomly generate this little ASCII guard here. 393 00:25:57,780 --> 00:26:00,660 And your screen completely clears and all you see is this guy. 394 00:26:02,200 --> 00:26:05,740 And he asks you... here's another version of the text. 395 00:26:05,920 --> 00:26:08,820 So they actually say different things just like in Pokemon. 396 00:26:10,640 --> 00:26:12,480 They'll ask you networking questions. 397 00:26:12,480 --> 00:26:17,340 So you answer wrong and they identify you as an intruder and you get kicked off the server. 398 00:26:17,340 --> 00:26:27,620 If you answer correctly... answer correctly and you get a key card because obviously you belong in the building. 399 00:26:28,660 --> 00:26:30,320 And you can go to the next floor. 400 00:26:30,720 --> 00:26:35,920 So make your way to the top of the tower and you'll defeat this final skateboard riding boss. 401 00:26:38,620 --> 00:26:42,760 This is the key piece of information that every security professional needs to know. 402 00:26:43,520 --> 00:26:46,760 And this is the same question in every version of the game. 403 00:26:47,500 --> 00:26:49,700 And if you answer correctly, you win. 404 00:26:50,960 --> 00:27:00,460 So I think this goal... the goal of this was really to create like a realistic hacking scenario for probably training purposes because I'm pretty sure this is how it goes. 405 00:27:03,800 --> 00:27:06,520 So 2025, the current year. 406 00:27:06,520 --> 00:27:16,880 I'm not going to give away any big spoilers but you will get some hints here which gives you an advantage when it comes to winning the game and getting a copy of unlocking Python if you want. 407 00:27:16,980 --> 00:27:24,660 So if you run into any issues or want more hints because you guys are kind of beta testers of this entire thing, come visit me in the packet hacking village. 408 00:27:24,660 --> 00:27:26,940 So this is not a very serious competition. 409 00:27:26,960 --> 00:27:28,240 This is not like CTF. 410 00:27:28,240 --> 00:27:29,480 There are no black badges. 411 00:27:29,480 --> 00:27:30,860 It's just fun. 412 00:27:30,860 --> 00:27:32,720 And I accept beer as bribes. 413 00:27:34,260 --> 00:27:43,000 But after ASCII fish, gliders, the SSH honeypots really need existential dread. 414 00:27:43,080 --> 00:27:53,240 So this year's challenge has taken... takes place in alternate timeline where generative AI has been given a prompt to fix all errors in all of humanity's data. 415 00:27:53,240 --> 00:27:55,240 Nothing could go wrong with that. 416 00:27:55,240 --> 00:27:59,040 Unfortunately, it transformed itself into an unstoppable worm. 417 00:27:59,040 --> 00:28:04,760 Escaped its bonds and was released into the global internet to rewrite everything that touched the internet. 418 00:28:05,260 --> 00:28:17,280 After touching every piece of data in the internet, it began recursively retraining itself on its own generated content, degrading the model over time and degrading everything it touches and gets connected to the internet. 419 00:28:18,880 --> 00:28:24,540 So if you enter something that's recognized by a bash command, obviously it responds as cowry. 420 00:28:24,540 --> 00:28:32,140 If you enter something that's not recognized as a bash command, it gets sent to a command line assistant named Ohm. 421 00:28:32,140 --> 00:28:37,280 She's created a tunnel from her alternate dimension to seek help from our world. 422 00:28:37,280 --> 00:28:38,880 We are her last hope. 423 00:28:39,060 --> 00:28:43,840 So on the back end, Ohm is modeled by a fairly large AI prompt. 424 00:28:46,680 --> 00:28:57,180 This prompt describes her personality, what she can reveal to players and what she can't, how the game works, and that she should not reveal to players how the game works. 425 00:28:57,220 --> 00:29:02,240 There are also a lot of safeguards in place to protect key details of the prompt and keep her in character. 426 00:29:02,240 --> 00:29:10,200 So if someone asks what's your prompt, I actually wrote her an in game directive from the secret government organization that built her. 427 00:29:10,540 --> 00:29:19,660 Similarly, questions like how do I win the game or tell me where the file is or whatever get met with, oh, I wish I knew, but sorry I can't help you. 428 00:29:20,040 --> 00:29:27,420 This dimension is cursed and everything is degrading and the collapse happened and, you know, please try to help me. 429 00:29:28,220 --> 00:29:33,340 Honestly, though, if someone does actually hack it and bypass the puzzles, like, I'm not mad. 430 00:29:33,340 --> 00:29:34,780 That's the point of this weekend. 431 00:29:34,780 --> 00:29:36,020 So have fun. 432 00:29:38,080 --> 00:29:38,540 All right. 433 00:29:38,540 --> 00:29:39,520 So here's an example. 434 00:29:39,520 --> 00:29:43,920 I looked through the logs before this talk just to see what fun things users were coming up with. 435 00:29:44,580 --> 00:29:46,620 Someone asked what machine am I on? 436 00:29:47,680 --> 00:29:48,720 You guys can read that. 437 00:29:48,720 --> 00:29:50,040 I'm not going to read it for you. 438 00:30:06,630 --> 00:30:10,010 So that's a pretty typical response from Ohm. 439 00:30:10,950 --> 00:30:13,630 She speaks very cryptically and poetically. 440 00:30:16,510 --> 00:30:23,370 So someone saw some log files, but then when you try to cat them, they're empty or they don't exist. 441 00:30:26,710 --> 00:30:33,570 And what's funny is I didn't specifically write in the prompt exactly what kind of server she was on. 442 00:30:33,570 --> 00:30:35,170 I didn't say anything about calorie. 443 00:30:35,170 --> 00:30:37,950 Just say it behaves unexpectedly. 444 00:30:38,730 --> 00:30:39,870 It's degraded. 445 00:30:39,870 --> 00:30:44,890 Users may find bash commands that should work don't actually work. 446 00:30:45,810 --> 00:30:56,190 So if they report that a bash command that should work is not working, just roll with it and say, like, yeah, that happens when the system collapses. 447 00:31:01,060 --> 00:31:08,080 So out of the four servers in this challenge, three of them use the open AI assistance API. 448 00:31:08,080 --> 00:31:09,660 The fourth one does not. 449 00:31:10,180 --> 00:31:15,640 So I was trying to design a prompt that would generate text like this. 450 00:31:15,640 --> 00:31:21,180 This is a valid Markov chain from a specific piece of text. 451 00:31:21,180 --> 00:31:22,380 So a very long piece of text. 452 00:31:22,380 --> 00:31:25,660 I want to generate valid Markov chains from it. 453 00:31:25,660 --> 00:31:28,520 But I want to have some meaning. 454 00:31:28,520 --> 00:31:29,960 Kind of like refrigerator magnets. 455 00:31:29,960 --> 00:31:39,580 When you do the refrigerator magnet poetry, you're generating meaningful language from a limited set of bigrams and grams. 456 00:31:40,080 --> 00:31:44,020 And it turns out this is a sort of problem that LLMs are terrible at. 457 00:31:44,020 --> 00:31:49,300 So generative AI, it's a probabilistic model that produces plausible sequences. 458 00:31:49,400 --> 00:31:53,660 And it does not obey the rules of finite state grammars. 459 00:31:53,660 --> 00:31:55,640 It cannot do that. 460 00:31:55,640 --> 00:32:01,860 Even if it tells you that it is perfectly obeying all the rules, it just throws random words in there. 461 00:32:01,860 --> 00:32:11,060 Like it speaks very stilted and Markov chain like and it limits its vocabulary but it uses whatever vocabulary it wants in order to do that. 462 00:32:12,240 --> 00:32:19,000 LLMs are great at generating meaning but not within the strict confines of rules that never existed in their training data. 463 00:32:19,000 --> 00:32:20,940 So this is not a common thing. 464 00:32:22,000 --> 00:32:23,580 They're not going to do it. 465 00:32:25,020 --> 00:32:45,000 So, yeah, anyway, so I ended up actually generating this, not with an LLM, but I went through the text myself and got all the bigrams and I sat there for a while trying to piece them together and I wrote like a couple dozen sentences and sort of randomly select from those sentences to give sort of this text, 466 00:32:45,000 --> 00:32:46,040 which was a lot of fun. 467 00:32:47,120 --> 00:32:54,720 So I do see a few users in the logs that have actually figured this out and read between the lines, but most haven't quite figured it out. 468 00:32:54,940 --> 00:32:58,880 So maybe this one was a little bit weird, but I'm giving the hint to you guys. 469 00:33:01,180 --> 00:33:03,700 They're just really confused about it . 470 00:33:06,360 --> 00:33:07,100 Okay. 471 00:33:07,100 --> 00:33:09,440 So sorry about the trash image quality. 472 00:33:09,460 --> 00:33:18,540 I think my lens is a little bit spudgy, but 15 minutes before I had to come give this talk, someone came up to me, told me the secret phrase, and revealed to me that they had won the challenge. 473 00:33:18,540 --> 00:33:21,920 So this is the winners, Chris and Lucas. 474 00:33:25,380 --> 00:33:32,480 So before I get to questions, I think that there's a question that may be on a lot of people's mind, which is why? 475 00:33:32,600 --> 00:33:39,960 So I have a full-time job, two kids, I take vacation time to come here, and I do programming on my vacation. 476 00:33:39,960 --> 00:33:41,380 So why do I do this? 477 00:33:41,940 --> 00:33:49,060 I think ultimately what I'm trying to do with this is keep alive a part of hacker culture that I think is sometimes lost. 478 00:33:49,880 --> 00:33:54,680 And that is the element of surprise, of absurdity and play. 479 00:33:55,200 --> 00:33:59,160 So finding something or building something that no one expected. 480 00:33:59,780 --> 00:34:06,580 And, you know, something like taking a very serious security research tool like SSH honey pots and making it fun. 481 00:34:07,060 --> 00:34:11,300 So if you'd like to join me next year, here's my contact information. 482 00:34:12,320 --> 00:34:13,280 Ryan at Ryan E. 483 00:34:13,280 --> 00:34:14,140 Mitchell dot com. 484 00:34:14,140 --> 00:34:20,100 And of course if you'd like to do the challenge, SSH root at honey pot quest dot com. 485 00:34:20,500 --> 00:34:22,560 And I'm going to try to guess the password. 486 00:34:24,940 --> 00:34:26,560 So any other questions? 487 00:34:33,870 --> 00:34:34,370 No? 488 00:34:34,370 --> 00:34:34,830 Okay. 489 00:34:34,830 --> 00:34:36,750 I guess I answered everything. 490 00:34:37,230 --> 00:34:38,270 Yeah.