1 00:00:00,000 --> 00:00:11,820 Hey. My name is Pub. Dr. Gonzo is my handle. I'm actually here with Hacker Joe, and we're going to talk about basically how we ran Capture the Flag for the past four years. 2 00:00:11,960 --> 00:00:17,240 Is anyone not familiar with Capture the Flag? All right, we'll find out a little bit about it. Put your hand down. 3 00:00:19,560 --> 00:00:35,140 Yeah, so we'll talk a little bit about sort of the intro of how it works and kind of go through some of the neat things that we did with the game and some of the ways that we basically just, you know, drove people completely bonkers trying to reverse engineer things and hack into code that they've never seen before. 4 00:00:36,980 --> 00:00:46,980 So just to give kind of an intro to the rest of the folks, because we are a very small part of a group, we have Invisigoth, Metro, Verbal, Bob, who's around here somewhere. 5 00:00:47,240 --> 00:00:51,660 The other guys aren't here. Of course, Hacker Joe and myself, Blackout, and RacerX. 6 00:00:51,780 --> 00:00:59,820 And we've had some folks, you know, we've been doing this for four years, so, you know, some of the folks that were on years one and two have left, and we've pulled some new folks in since then. 7 00:01:00,680 --> 00:01:06,860 But, yeah, that's basically the whole story. And I have to thank all of the gophers that have ever helped us run it. 8 00:01:06,900 --> 00:01:17,220 I don't think it would ever be possible, because you get, you know, a group of, like, say, ten geeks together, and you realize that they'll sit down and start hacking code, and nobody's, like, eating for, like, 24 hours, and, you know, everyone's just kind of, like, 9 00:01:17,240 --> 00:01:23,540 you know, ugly and dirty and smelly, and you really need people to kind of help out, because otherwise, you just sort of spiral off the deep end. 10 00:01:23,620 --> 00:01:28,900 So, none of this would have ever been possible without them to sort of keep us fed and Red Bulled up and all that kind of good stuff, so. 11 00:01:29,540 --> 00:01:36,940 I'm going to actually turn it over to Hacker Joe to kind of go through the background of Capture the Flag, and how the game sort of evolved over the past four years that we've been doing it. 12 00:01:37,000 --> 00:01:41,240 And then I'll take back over and talk about some of the lessons learned and some of the crazy shit that ended up happening. 13 00:01:41,760 --> 00:01:46,980 And then at the end, we'll talk through some of the particular challenges that we had that were always... 14 00:01:46,980 --> 00:01:50,860 Some of them were a little fun, some of them were just crazy hard, and hopefully you'll enjoy it. 15 00:01:58,840 --> 00:01:59,840 Annoying noises with the mic. 16 00:01:59,940 --> 00:02:04,180 Okay, so, for the past four years, Conjura ran CTF. 17 00:02:04,220 --> 00:02:06,600 For the three years before that, it was the Ghetto Hackers. 18 00:02:06,640 --> 00:02:10,420 Talk a little bit about the background and the evolving of the game. 19 00:02:11,440 --> 00:02:15,500 Pretty much, if you look at the background, a brief history of how it works. 20 00:02:17,160 --> 00:02:30,680 It started as a game, you've probably heard Capture the Flag and lots of other things, Halo, Capture the Flag tournaments, kids play Capture the Flag, you put one kid on top of a hill, King of the Hill contests, but anyways, the deal is the guy with the points wins, right? 21 00:02:32,100 --> 00:02:36,620 The Capture the Flag at DEFCON has been a head-to-head, team-based hacking contest. 22 00:02:36,960 --> 00:02:42,280 An all-out little elite skills testing game, running for three days. 23 00:02:42,420 --> 00:02:43,700 It's in the big room down there. 24 00:02:43,840 --> 00:02:46,100 Those of you who walked by in years past probably know what it is. 25 00:02:46,100 --> 00:02:50,080 Don't know what CTF was, knew it as the game, the big room with all the cool videos running. 26 00:02:50,920 --> 00:02:52,040 Thanks to Bob's. 27 00:02:54,980 --> 00:02:59,660 But the idea is to be a real-time test of offensive and defensive skills today. 28 00:03:00,800 --> 00:03:07,400 Where it evolved to over the years is a lot of application security versus the traditional host-based security. 29 00:03:07,840 --> 00:03:14,640 But the idea is each team has a server, they're going to set up, you have to attack, you have to defend, and you have to have the most points to win. 30 00:03:16,660 --> 00:03:19,500 A big game setup in the past has kind of looked like this. 31 00:03:19,600 --> 00:03:21,660 You've got the eight teams running around the room. 32 00:03:23,400 --> 00:03:26,440 Very early pitcher. It's not a disaster, which it'll look like on Sunday. 33 00:03:27,740 --> 00:03:29,500 There's a star topology for the network. 34 00:03:30,340 --> 00:03:32,600 Our table's in the middle, the team's around the edge. 35 00:03:32,820 --> 00:03:36,120 We cable everybody in and all the teams play head-to-head. 36 00:03:40,000 --> 00:03:44,300 If you look back at the history of where it went, if you look at the early days of DEFCON, 37 00:03:44,720 --> 00:03:46,080 coming up, we call it the DEC, we call it the DEFCON. 38 00:03:46,080 --> 00:03:52,520 the Stone Ages, all the way up through Defcon 4 through Defcon 9, the Dark Ages of Chaos. 39 00:03:52,720 --> 00:03:55,240 You had various different games run mostly by the goons. 40 00:03:55,920 --> 00:03:59,580 You had games that were run just in complete chaos. 41 00:03:59,760 --> 00:04:03,020 Just a whole bunch of people got together and decided to say, hey, you're the red team, 42 00:04:03,060 --> 00:04:05,540 you're the blue team, we're just going to, you know, you guys defend, we'll hack. 43 00:04:06,180 --> 00:04:10,720 You had a game that evolved over the years and started getting organization. 44 00:04:11,720 --> 00:04:15,660 You had groups that would show up to be admins. 45 00:04:15,660 --> 00:04:17,380 They would bring servers to defend. 46 00:04:18,280 --> 00:04:20,080 You would have groups that would show up and be hackers. 47 00:04:20,540 --> 00:04:26,680 But you still had a very chaotic game with scoring that at one point got as bad as you raised your hand 48 00:04:26,680 --> 00:04:29,460 if you thought you had root on a box and somebody came and verified it. 49 00:04:31,420 --> 00:04:33,640 It was kind of silly at some point, right? 50 00:04:34,140 --> 00:04:38,020 You had people sleeping in boxes in the room to prove they could hack all the servers 51 00:04:38,020 --> 00:04:38,840 where everybody went to bed. 52 00:04:41,260 --> 00:04:42,660 It was very chaotic. 53 00:04:42,760 --> 00:04:44,820 And then it started moving. 54 00:04:44,920 --> 00:04:45,440 It's kind of... 55 00:04:45,660 --> 00:04:49,040 What we call the golden age of Ghetto. 56 00:04:49,400 --> 00:04:52,500 The Ghetto hackers took over at DEF CON 10. 57 00:04:52,920 --> 00:04:56,900 And they said, we're going to build a game that has a structured organization to it, 58 00:04:56,940 --> 00:04:59,120 and we're going to qualify teams to come play. 59 00:04:59,500 --> 00:05:04,180 So the first time that the game wasn't walk into DEF CON, play Capture the Flag. 60 00:05:04,980 --> 00:05:09,280 So they qualified teams, ran a game with eight teams playing head-to-head. 61 00:05:09,540 --> 00:05:12,040 They named their Capture the Flag game Root Fu. 62 00:05:13,200 --> 00:05:15,280 And some people, I think I heard it called Root Wars. 63 00:05:15,660 --> 00:05:17,760 But mostly Root Fu was the name you saw prevalent there. 64 00:05:19,740 --> 00:05:24,400 The last four years, the Kenshodo Renaissance, the game changed drastically yet again. 65 00:05:24,860 --> 00:05:28,180 And it moved to the same style. 66 00:05:28,300 --> 00:05:30,160 We qualified teams to show up and play. 67 00:05:33,200 --> 00:05:35,580 We moved a lot more into the application space. 68 00:05:36,480 --> 00:05:39,400 Initially, we even moved away from the defense. 69 00:05:39,560 --> 00:05:40,360 And we'll talk about that. 70 00:05:40,420 --> 00:05:45,380 We actually let the defense back into the game as we realized we moved too far away from that. 71 00:05:46,340 --> 00:05:52,360 There's a talk immediately after this one by Cyphertex, who was on Atlas' last place team, 72 00:05:52,460 --> 00:05:56,120 who's played the last couple of years, who's going to go into some more of the history in the game 73 00:05:56,120 --> 00:06:01,760 and what it's like playing the game and how you win CTF, from his opinion, since they've won. 74 00:06:02,440 --> 00:06:04,180 So that'll be a different talk. 75 00:06:04,420 --> 00:06:06,120 We're going to talk a little bit about different things. 76 00:06:06,240 --> 00:06:10,080 So looking at those past four years, like I said, we qualified the teams to show up. 77 00:06:11,140 --> 00:06:15,320 How that happened would be somewhere, it was always the end of May, beginning of June. 78 00:06:15,660 --> 00:06:19,060 We run an online challenge called Qualifications, or QUALs for short. 79 00:06:19,880 --> 00:06:22,960 Typically, we have about 200 teams now playing in the QUALs. 80 00:06:22,980 --> 00:06:26,660 I think DD Tech, who's running it this year, announced they had right about the same. 81 00:06:26,760 --> 00:06:30,140 They had a little over 200 teams that signed up, played online in the QUALs. 82 00:06:31,980 --> 00:06:35,720 The popularity of CTF growing has been interesting to watch. 83 00:06:35,880 --> 00:06:37,740 And it's been even comical stories. 84 00:06:37,960 --> 00:06:43,200 Like year two, while we ran the QUALs, we had it running at John's company. 85 00:06:43,620 --> 00:06:45,440 We had a hosted VM. 86 00:06:45,440 --> 00:06:46,440 We had a VM at John's company, right? 87 00:06:47,280 --> 00:06:47,960 QUALs are running. 88 00:06:48,220 --> 00:06:49,720 All of a sudden, our QUAL server disappears. 89 00:06:51,520 --> 00:06:54,180 Call back up John's company, like, yeah, we shut you guys off for hacking. 90 00:06:56,560 --> 00:06:57,160 Yeah, really. 91 00:06:57,620 --> 00:06:57,980 Seriously. 92 00:06:58,520 --> 00:06:59,780 So they turned us back on. 93 00:06:59,920 --> 00:07:01,540 About an hour later, they shut us off again. 94 00:07:01,700 --> 00:07:03,500 We were starving the resources on the whole server. 95 00:07:04,580 --> 00:07:05,720 Took about four hours. 96 00:07:05,840 --> 00:07:11,680 We actually relocated it, ran it off a server in my basement in Atlanta, because at the 97 00:07:11,680 --> 00:07:14,420 time, I worked for a cable company and had an uncapped cable modem. 98 00:07:18,220 --> 00:07:19,540 So we had mad bandwidth. 99 00:07:19,680 --> 00:07:21,640 So QUALs ran that year in my basement. 100 00:07:21,720 --> 00:07:22,320 It was kind of fun. 101 00:07:24,280 --> 00:07:26,060 But you've got to be prepared for this, right? 102 00:07:26,440 --> 00:07:32,440 When things get popular and you have 200 teams trying to brute force their way through 103 00:07:32,440 --> 00:07:35,680 mad binaries you've put on a server, it can get overwhelming. 104 00:07:38,080 --> 00:07:42,040 In the QUALs, one of the things that we kept was we've always invited the champion back. 105 00:07:43,120 --> 00:07:48,020 Very rarely has the champion been able to repeat their victory twice in a row, but we've 106 00:07:48,020 --> 00:07:49,120 always invited them to come back. 107 00:07:49,280 --> 00:07:52,940 So whoever wins, we've always kept the same as Ghetto has it. 108 00:07:53,020 --> 00:07:56,900 Whoever won last year gets an automatic seat at the table for the next year. 109 00:07:57,780 --> 00:08:01,980 DD Tech kept that privilege this year and invited the winners back automatically. 110 00:08:02,460 --> 00:08:05,600 And they've moved it up to 10 teams this year. 111 00:08:05,660 --> 00:08:09,860 So they qualified nine, plus brought back the last year's champion. 112 00:08:10,040 --> 00:08:11,240 All right. 113 00:08:15,220 --> 00:08:15,820 So let's move on. 114 00:08:15,820 --> 00:08:16,820 So some evolving of the game. 115 00:08:18,860 --> 00:08:20,060 So how's the game changed? 116 00:08:20,240 --> 00:08:22,340 As I said, now we have eight teams. 117 00:08:22,860 --> 00:08:27,200 So if you remember just before Ghetto took over, if anybody was at the Alexis Park, you 118 00:08:27,200 --> 00:08:30,700 can remember just walking into a big room and seeing long tables of hundreds of people 119 00:08:31,260 --> 00:08:34,240 just trying to sit around tables and play with no idea who was doing what. 120 00:08:34,780 --> 00:08:36,780 You saw now that it's organized by team. 121 00:08:36,940 --> 00:08:39,060 Not only that, that they actually color-coded. 122 00:08:39,180 --> 00:08:40,700 You see the color-coded banners on the table? 123 00:08:40,700 --> 00:08:43,220 The scoreboard's color-coded, you can track what's going on. 124 00:08:44,200 --> 00:08:49,200 The architecture's built with, you could say, a specialized network architecture. 125 00:08:49,540 --> 00:08:53,000 We'll have some slides on that, a little bejesus. 126 00:08:53,100 --> 00:08:57,740 Turns out it gets hard to run a hostile network in a hacking competition. 127 00:08:59,140 --> 00:09:01,480 Imagine that, somebody who likes to hack your network. 128 00:09:02,740 --> 00:09:06,440 Typically we've given each team 20 to 25 custom services. 129 00:09:06,760 --> 00:09:08,480 This is the big change Kinshoto made. 130 00:09:08,480 --> 00:09:11,320 We didn't stick stock services on. 131 00:09:11,400 --> 00:09:15,680 You weren't defending your mail server, a web server, Telnet, SSH. 132 00:09:15,840 --> 00:09:19,780 You were defending 20 to 25 custom applications written by Kinshoto. 133 00:09:20,000 --> 00:09:22,600 All had unique exploitable conditions in them. 134 00:09:23,160 --> 00:09:27,380 Sometimes they had other unique exploitable conditions that Kinshoto didn't think would 135 00:09:27,380 --> 00:09:27,820 be in those. 136 00:09:29,060 --> 00:09:29,940 It's all good. 137 00:09:31,420 --> 00:09:35,380 You get points for steals, overwrites, breakthroughs, and an SLA. 138 00:09:35,560 --> 00:09:38,140 And I'll give you guys a hint on how we ran that. 139 00:09:39,040 --> 00:09:40,620 So the scores are steals. 140 00:09:41,600 --> 00:09:43,700 All the services have in them some sort of a key. 141 00:09:44,700 --> 00:09:45,920 You have to find that key. 142 00:09:46,200 --> 00:09:50,360 If you can find the key in the service, which means you've gotten read access someplace 143 00:09:50,360 --> 00:09:56,020 that wasn't necessarily exposed in that app, or maybe it was exposed and it just had the 144 00:09:56,020 --> 00:10:00,340 key out, some of them are very easy, you could take that key and we had a key submission 145 00:10:00,340 --> 00:10:03,000 system and you could submit your key and score points for a steal. 146 00:10:03,620 --> 00:10:04,900 One point for each key. 147 00:10:05,140 --> 00:10:06,740 We replaced the keys randomly. 148 00:10:06,740 --> 00:10:08,700 Randomly, about every five to ten minutes. 149 00:10:10,340 --> 00:10:11,600 We'll talk about that a little more. 150 00:10:13,540 --> 00:10:17,140 There was also a second level, the next harder level were overwrites. 151 00:10:17,680 --> 00:10:23,480 If you could replace the key, when we came back and looked for a key, or we were looking 152 00:10:23,480 --> 00:10:28,060 for the key to have changed through the operating system, if the key is overwritten, you get 153 00:10:28,060 --> 00:10:28,800 the overwrite points. 154 00:10:29,100 --> 00:10:33,340 So if you're the blue team and you've stuck your key on the green team server, we check 155 00:10:33,340 --> 00:10:35,660 the green server and pull back blue's token. 156 00:10:35,660 --> 00:10:38,740 Blue gets points for an overwrite. 157 00:10:44,340 --> 00:10:44,820 Breakthroughs. 158 00:10:45,600 --> 00:10:46,500 Here's the challenge. 159 00:10:46,720 --> 00:10:47,780 You're on a wide open network. 160 00:10:48,100 --> 00:10:49,140 It's like the real world. 161 00:10:49,720 --> 00:10:52,480 You write a vulnerability and put it out there, everybody knows it. 162 00:10:52,860 --> 00:10:55,160 Your uniqueness is gone as soon as you expose it. 163 00:10:55,460 --> 00:10:57,560 You can't pull it back off the wire. 164 00:10:58,160 --> 00:11:03,780 The first team to successfully land an overwrite gets breakthrough points to reward them for 165 00:11:03,780 --> 00:11:05,020 having a working exploit. 166 00:11:05,660 --> 00:11:06,900 actually landed a payload. 167 00:11:07,600 --> 00:11:10,980 The second team and the third team are also given points, 168 00:11:11,180 --> 00:11:13,320 maybe because they also solved them on their own, 169 00:11:13,360 --> 00:11:14,980 or maybe they were the first one to recognize it 170 00:11:14,980 --> 00:11:16,040 on the wire and replay it. 171 00:11:17,500 --> 00:11:19,620 Regardless, you're the second one, you get half the points, 172 00:11:19,680 --> 00:11:21,140 you're the third one, you get a quarter of the points. 173 00:11:21,300 --> 00:11:22,820 Breakthrough points are done for that service. 174 00:11:23,460 --> 00:11:26,680 The services are on difficulty from easy, hard, 175 00:11:26,840 --> 00:11:28,960 and ridiculously hard, we called Kinshoto. 176 00:11:33,320 --> 00:11:36,820 The overall score actually was multiplied by an SLA. 177 00:11:37,420 --> 00:11:40,180 And so this was a big change in the game in the state. 178 00:11:40,400 --> 00:11:42,280 You had to keep your services up and running. 179 00:11:42,640 --> 00:11:45,340 We checked your services, as we pull your services 180 00:11:45,340 --> 00:11:47,720 if they're not working, we're going to take points away. 181 00:11:47,960 --> 00:11:49,340 We're going to deduct your SLA. 182 00:11:49,960 --> 00:11:52,120 We're going to take all the points you scored during the 183 00:11:52,120 --> 00:11:55,060 game and we're going to multiply it by your SLA at the end. 184 00:11:55,500 --> 00:11:57,220 So if you shut all your services off, 185 00:11:57,300 --> 00:11:58,800 you can root the boxes all damn day. 186 00:11:58,960 --> 00:11:59,820 And you're going to get zero points. 187 00:12:01,140 --> 00:12:04,200 So everybody has to keep their targets up. 188 00:12:04,280 --> 00:12:06,760 That way everybody gets to hack all week or all weekend. 189 00:12:08,720 --> 00:12:10,220 So that's the way it broke down. 190 00:12:12,300 --> 00:12:12,840 You ready? 191 00:12:13,100 --> 00:12:14,180 All right. 192 00:12:14,220 --> 00:12:16,560 I headed back to Pub to go over some of the lessons we 193 00:12:16,560 --> 00:12:18,660 learned in kind of evolution of the game theory. 194 00:12:19,960 --> 00:12:22,380 There's actually two other scoring things that we forgot 195 00:12:22,380 --> 00:12:23,620 to mention, which was penalties. 196 00:12:23,800 --> 00:12:26,340 So if people were being idiots, we would penalize them. 197 00:12:26,380 --> 00:12:27,460 That also cost people some points. 198 00:12:29,360 --> 00:12:32,300 And then there was also the standing rule that we had 199 00:12:32,300 --> 00:12:34,440 since the first year we did it, which is you can attack our 200 00:12:34,440 --> 00:12:35,260 game infrastructure. 201 00:12:36,240 --> 00:12:38,700 And if you own it, then we'll give you points. 202 00:12:39,080 --> 00:12:42,720 But if we find you before you own it, penalized. 203 00:12:43,540 --> 00:12:44,220 So yeah. 204 00:12:44,320 --> 00:12:46,800 But thankfully, I don't think we actually got owned too 205 00:12:46,800 --> 00:12:48,800 badly throughout the years, which is kind of a good thing. 206 00:12:49,800 --> 00:12:50,140 OK. 207 00:12:50,220 --> 00:12:51,220 So let's talk about some lessons learned. 208 00:12:52,400 --> 00:12:54,780 As H.J. mentioned, running a game for hackers is kind of 209 00:12:54,780 --> 00:12:58,080 hard, because anything that they can see, they're 210 00:12:58,080 --> 00:12:58,840 basically going to attack. 211 00:12:58,960 --> 00:13:00,460 I mean, that's sort of the environment 212 00:13:00,460 --> 00:13:01,240 you're putting it into. 213 00:13:01,600 --> 00:13:03,580 You're basically throwing a bunch of bloody meat in the 214 00:13:03,580 --> 00:13:04,540 water and waiting for the sharks. 215 00:13:05,020 --> 00:13:08,660 So you have to basically allow people to explore everything 216 00:13:08,660 --> 00:13:10,640 that's on the network, attack anything that they find. 217 00:13:10,940 --> 00:13:12,920 But you have to keep your game infrastructure, the 218 00:13:12,920 --> 00:13:15,100 backbone, so to speak, kind of protected. 219 00:13:15,200 --> 00:13:17,280 Because otherwise, pretty much the whole thing goes to shit. 220 00:13:17,360 --> 00:13:18,260 You don't really have a game anymore. 221 00:13:19,380 --> 00:13:21,920 So that has a huge amount of implications for how you 222 00:13:21,920 --> 00:13:22,860 actually design things. 223 00:13:24,240 --> 00:13:26,620 And effectively, what that ends up coming down to is that 224 00:13:26,620 --> 00:13:28,340 our network topology just got strange. 225 00:13:28,340 --> 00:13:30,700 And I'll give you an idea of how strange it got. 226 00:13:30,920 --> 00:13:33,840 So let's say you're a team competing in the game. 227 00:13:34,000 --> 00:13:36,400 So H.J. mentioned that we have kind of a star topology. 228 00:13:36,700 --> 00:13:38,360 This is what it would look like to you. 229 00:13:38,540 --> 00:13:40,800 So the idea being that you have sort of the eight teams 230 00:13:40,800 --> 00:13:43,120 that have their servers that are across the bottom, the 231 00:13:43,120 --> 00:13:45,940 eight teams themselves actually cable in on the little clouds 232 00:13:45,940 --> 00:13:47,780 that you see in the middle, and that they're all connected 233 00:13:47,780 --> 00:13:48,780 basically to a router. 234 00:13:48,860 --> 00:13:52,180 So a team effectively kind of sits between their server and 235 00:13:52,180 --> 00:13:54,400 the game network, and they just plug them into a switch 236 00:13:54,400 --> 00:13:56,100 together, and then their server's on the game network. 237 00:13:57,400 --> 00:13:58,700 Hopefully, pretty straightforward, yeah? 238 00:14:00,140 --> 00:14:03,320 Well, the actual design of the network itself was a little 239 00:14:03,320 --> 00:14:04,220 bit more hardcore than that. 240 00:14:04,480 --> 00:14:05,740 It actually looked like this. 241 00:14:08,040 --> 00:14:10,520 And just to give you an idea, I guess I can talk through it 242 00:14:10,520 --> 00:14:12,900 a little bit, though we'll probably save a lot of the 243 00:14:12,900 --> 00:14:14,720 questions about it for Q&A if you really want to know, 244 00:14:14,780 --> 00:14:15,940 because it's a little bit bonkers. 245 00:14:16,020 --> 00:14:19,900 But the idea is that each team actually had a server that was 246 00:14:19,900 --> 00:14:21,200 running in a FreeBSD jail. 247 00:14:21,900 --> 00:14:25,060 The FreeBSD jail was running on a FreeBSD instance that was 248 00:14:25,060 --> 00:14:25,720 running in VMware. 249 00:14:26,180 --> 00:14:28,680 There were four VMware images running on each of our 250 00:14:28,680 --> 00:14:29,340 physical hosts. 251 00:14:30,320 --> 00:14:33,460 And then basically, that allowed us to actually have a 252 00:14:33,460 --> 00:14:38,140 back channel into each server, so we could actually log into 253 00:14:38,140 --> 00:14:41,260 the host FreeBSD OS and poke at things that were happening 254 00:14:41,260 --> 00:14:43,100 in the jail without really worrying about it. 255 00:14:43,140 --> 00:14:45,360 It also gave us the extra sort of belt and suspenders feel 256 00:14:45,360 --> 00:14:47,360 that you would have to be able to actually break out of your 257 00:14:47,360 --> 00:14:49,960 jail and then break out of VMware in order to actually 258 00:14:49,960 --> 00:14:51,720 attack our game infrastructure, which made us feel a 259 00:14:51,720 --> 00:14:52,120 little bit better. 260 00:14:52,440 --> 00:14:54,340 Nobody managed to pull it off, at least to our knowledge, 261 00:14:54,360 --> 00:14:55,700 unless they pulled it off really, really well. 262 00:14:57,680 --> 00:15:00,180 So the rest of the stuff that you see on the side are 263 00:15:00,180 --> 00:15:01,480 actually parts of the infrastructure. 264 00:15:01,700 --> 00:15:03,180 So we talked about running service polls. 265 00:15:03,460 --> 00:15:04,800 That's got to come from somewhere, right? 266 00:15:04,840 --> 00:15:05,760 So we have a polling server. 267 00:15:06,560 --> 00:15:09,740 Each team actually has a lot of database-driven applications 268 00:15:09,740 --> 00:15:11,180 that they're defending as well. 269 00:15:11,380 --> 00:15:13,360 So we have a database that sits on the back end. 270 00:15:13,420 --> 00:15:14,540 I'll talk a little bit about that in a second. 271 00:15:15,180 --> 00:15:17,460 And we also, of course, have the scoring server that keeps 272 00:15:17,460 --> 00:15:18,600 the tallies and everything else. 273 00:15:19,180 --> 00:15:23,460 And then across the top, you have things that run the game 274 00:15:23,460 --> 00:15:25,060 itself, so we have the scoreboard that actually 275 00:15:25,060 --> 00:15:25,940 projects up on the wall. 276 00:15:26,100 --> 00:15:27,760 That's tied directly into the game network. 277 00:15:28,100 --> 00:15:29,720 And then the firewall itself. 278 00:15:30,080 --> 00:15:32,300 And there's actually another box on here that I'll talk 279 00:15:32,300 --> 00:15:34,600 about in a second that's affectionately known as our, 280 00:15:35,040 --> 00:15:35,960 what do we call it again? 281 00:15:36,120 --> 00:15:37,180 The packet fucking sprayer? 282 00:15:37,820 --> 00:15:39,140 Yeah, we'll talk about that in a second. 283 00:15:40,020 --> 00:15:41,560 OK, so why so complicated? 284 00:15:41,640 --> 00:15:44,260 I already talked about a few of these implications. 285 00:15:44,620 --> 00:15:47,900 But the idea was that when you're scoring overwrites, 286 00:15:47,960 --> 00:15:51,180 how do you actually detect if someone's just running a 287 00:15:51,180 --> 00:15:53,760 service on a server that they control, how do you detect 288 00:15:53,760 --> 00:15:54,900 when someone overwrites it? 289 00:15:54,900 --> 00:15:57,380 As it turns out, the way that the ghetto did it was 290 00:15:57,380 --> 00:15:58,440 actually pretty simple. 291 00:15:58,540 --> 00:16:00,360 They would actually just come in with the polling server and 292 00:16:00,360 --> 00:16:03,040 grab the key, which caused kind of crazy conditions where 293 00:16:03,040 --> 00:16:05,740 people would own a service and then write a tight loop that 294 00:16:05,740 --> 00:16:08,040 would just keep overwriting their key so that whenever 295 00:16:08,040 --> 00:16:10,200 that polling server came by, their key would be the one 296 00:16:10,200 --> 00:16:12,180 there, and you'd have like seven teams owning the same 297 00:16:12,180 --> 00:16:14,720 service, all of them overwriting thrashed machines, 298 00:16:15,060 --> 00:16:16,120 thrashed drives, kind of a mess. 299 00:16:16,380 --> 00:16:19,640 So the way we did it instead was to actually have a kernel 300 00:16:19,640 --> 00:16:24,880 module that would basically monitor the service and then 301 00:16:24,880 --> 00:16:25,880 monitor the files themselves. 302 00:16:26,260 --> 00:16:28,560 And so as soon as you got overwritten, basically you 303 00:16:28,560 --> 00:16:30,720 could overwrite a file and then cap the file, and it would 304 00:16:30,720 --> 00:16:31,440 look like nothing happened. 305 00:16:31,700 --> 00:16:35,080 But the kernel module would detect that you actually 306 00:16:35,860 --> 00:16:37,120 overwrote it and score you points automatically. 307 00:16:37,560 --> 00:16:39,060 So it was actually kind of neat. 308 00:16:39,180 --> 00:16:41,620 And then we had also database trigger set up. 309 00:16:41,680 --> 00:16:44,220 So as soon as you would actually overwrite a field in a 310 00:16:44,220 --> 00:16:46,700 database on a particular table, it would automatically detect 311 00:16:46,700 --> 00:16:48,360 that you did that and score you points as well. 312 00:16:48,480 --> 00:16:52,340 So the scoring itself was very much streamlined so that you 313 00:16:52,340 --> 00:16:54,220 didn't really have as many sort of race conditions, and 314 00:16:54,220 --> 00:16:54,860 people that actually overwrote the data, they were able to 315 00:16:54,880 --> 00:16:56,480 actually own services, would get points for them as soon as 316 00:16:56,480 --> 00:16:57,880 they did, which was good. 317 00:16:58,920 --> 00:17:01,060 Of course, the rest of the complication was due to the 318 00:17:01,060 --> 00:17:03,140 fact that we wanted to keep most of the things that were 319 00:17:03,140 --> 00:17:06,060 actually game infrastructure outside of what the teams 320 00:17:06,060 --> 00:17:06,880 could actually get to. 321 00:17:07,400 --> 00:17:09,580 And another kind of requirement that we wanted to 322 00:17:09,580 --> 00:17:12,020 uphold was making it so that you didn't actually know who 323 00:17:12,020 --> 00:17:12,700 was attacking you. 324 00:17:12,820 --> 00:17:16,300 So effectively, if you were sitting on a team network, it 325 00:17:16,300 --> 00:17:18,020 looked like every connection, at least for the first couple 326 00:17:18,020 --> 00:17:20,320 years, it looked like every connection was just coming from 327 00:17:20,320 --> 00:17:20,960 your gateway address. 328 00:17:21,760 --> 00:17:24,620 So you were sort of sitting on the other side of a NAT, so 329 00:17:24,620 --> 00:17:24,820 to speak. 330 00:17:24,960 --> 00:17:27,420 So all the rest of the seven teams were NATed to your 331 00:17:27,420 --> 00:17:30,060 network, which added a lot more complication as well. 332 00:17:30,160 --> 00:17:32,020 But it was cool, because that way you wouldn't really know. 333 00:17:32,160 --> 00:17:34,020 And of course, you don't want people to be able to detect 334 00:17:34,020 --> 00:17:36,680 the polling server as opposed to detecting other teams' 335 00:17:36,840 --> 00:17:39,120 exploits, because otherwise they would just write some 336 00:17:39,120 --> 00:17:41,440 firewall rules or put something in line that would just block 337 00:17:41,440 --> 00:17:44,020 all the other teams' traffic and just allow the polling 338 00:17:44,020 --> 00:17:44,820 traffic to come through. 339 00:17:44,900 --> 00:17:46,340 So it would look like they were up, but nobody would 340 00:17:46,340 --> 00:17:47,280 actually be able to attack them. 341 00:17:47,640 --> 00:17:48,900 So that's an important part as well. 342 00:17:51,480 --> 00:17:52,560 So server access. 343 00:17:53,460 --> 00:17:58,260 We actually always ran all the servers on our hardware on our 344 00:17:58,260 --> 00:18:00,980 systems, because at least for the first couple years, we 345 00:18:00,980 --> 00:18:02,940 didn't want to have any inline defenses. 346 00:18:03,160 --> 00:18:05,320 So we didn't want people to put up packet filters and 347 00:18:05,320 --> 00:18:07,520 things of that nature that would filter out shell code 348 00:18:07,520 --> 00:18:08,280 and things like that. 349 00:18:08,860 --> 00:18:11,080 Or we didn't want people to do server replacements. 350 00:18:11,140 --> 00:18:12,960 We wanted them to actually play the game that we set up 351 00:18:12,960 --> 00:18:15,400 for them to play and make sure that everyone was playing on 352 00:18:15,400 --> 00:18:15,800 equal footing. 353 00:18:16,820 --> 00:18:19,260 And in addition to that, we wanted to have a kind of 354 00:18:19,260 --> 00:18:20,260 consistent game state. 355 00:18:20,340 --> 00:18:22,340 Because of the layers of jail inside of the 356 00:18:22,560 --> 00:18:24,720 VMware and so forth, we were able to just do things like 357 00:18:24,720 --> 00:18:27,580 take VM snapshots and so forth so that if someone came up and 358 00:18:27,580 --> 00:18:31,740 accidentally hosed their own VM or hosed their own server, we 359 00:18:31,740 --> 00:18:33,800 could just go and revert them to a previous VMware snapshot 360 00:18:33,800 --> 00:18:34,500 and that kind of stuff. 361 00:18:34,660 --> 00:18:36,080 So that worked out pretty well, all in all. 362 00:18:37,780 --> 00:18:40,380 The problem was is that you still have to, if you're doing 363 00:18:40,380 --> 00:18:42,180 that and you're keeping all the servers yourself, you still 364 00:18:42,180 --> 00:18:44,480 have to give teams a packet dump of the traffic coming to 365 00:18:44,480 --> 00:18:45,220 and fro their server. 366 00:18:45,380 --> 00:18:47,560 Because otherwise, it's really difficult to see what the hell 367 00:18:47,560 --> 00:18:49,820 is going on and to understand what any other team is doing. 368 00:18:50,280 --> 00:18:52,440 Because they're running in FreeBSD jails, you can't 369 00:18:52,440 --> 00:18:55,360 give them access directly to the interface because it just 370 00:18:55,360 --> 00:18:55,980 doesn't work like that. 371 00:18:56,100 --> 00:19:00,680 So we had to kind of come up with a way to give every team 372 00:19:00,680 --> 00:19:01,220 their packets. 373 00:19:01,480 --> 00:19:03,920 Hence, now I'm about to tell you about the packet fucking 374 00:19:03,920 --> 00:19:04,280 sprayer. 375 00:19:04,360 --> 00:19:06,160 So we had this problem. 376 00:19:06,300 --> 00:19:08,040 The first year we were doing this, we thought, oh, we had 377 00:19:08,040 --> 00:19:09,080 it all drawn up on a board. 378 00:19:09,300 --> 00:19:10,240 We're like, this is perfect. 379 00:19:10,360 --> 00:19:11,740 This network architecture is totally going to work. 380 00:19:11,820 --> 00:19:12,080 We're done. 381 00:19:12,260 --> 00:19:14,580 All we've got to do is go in, bang out some PF rules on a 382 00:19:14,580 --> 00:19:16,260 box that has like 10 interfaces on it. 383 00:19:16,500 --> 00:19:19,700 We'll just put a trunk line that has 8 VLANs running over 384 00:19:19,700 --> 00:19:20,920 the trunk, and we'll just break it out. 385 00:19:20,960 --> 00:19:22,320 We'll just make it like an 8 port spam. 386 00:19:22,440 --> 00:19:23,400 And for each VLAN. 387 00:19:23,520 --> 00:19:26,100 So each VLAN would be just coming out of a port, as if 388 00:19:26,100 --> 00:19:26,740 they were spams. 389 00:19:27,500 --> 00:19:30,620 As it turns out, we actually have no idea how to do that. 390 00:19:32,700 --> 00:19:36,180 And so the first year, I sat down. 391 00:19:36,500 --> 00:19:38,740 I think it was HJ and I. We sat down, and we were kind of 392 00:19:39,100 --> 00:19:40,880 scratching our heads, writing some PF rules. 393 00:19:41,020 --> 00:19:43,060 We had dupe twos going everywhere, and all kinds of 394 00:19:43,060 --> 00:19:43,280 madness. 395 00:19:44,120 --> 00:19:46,180 And the packets just weren't leaving the box. 396 00:19:46,380 --> 00:19:47,600 And we just couldn't figure out why. 397 00:19:48,140 --> 00:19:49,300 We had this coming in. 398 00:19:49,380 --> 00:19:50,840 We had the VLANs separated properly. 399 00:19:51,020 --> 00:19:52,380 All the rules were there. 400 00:19:52,380 --> 00:19:53,520 Why weren't the packets going out? 401 00:19:54,140 --> 00:19:57,380 And so hence the outstanding challenge, which stands to 402 00:19:57,380 --> 00:19:57,780 this day. 403 00:19:57,940 --> 00:20:00,160 If someone can tell me how to do this, I'll buy you a beer. 404 00:20:00,240 --> 00:20:01,440 I'll buy you a bottle of vodka. 405 00:20:01,600 --> 00:20:02,520 Any vodka you'd like. 406 00:20:04,460 --> 00:20:06,520 Because really, as it turns out, once you have this 407 00:20:06,520 --> 00:20:08,620 problem, you can't get the packets out of the box. 408 00:20:08,760 --> 00:20:09,020 Why? 409 00:20:09,220 --> 00:20:10,000 Anyone know why? 410 00:20:12,220 --> 00:20:12,620 ARP. 411 00:20:14,660 --> 00:20:18,060 Well-behaving NICs don't actually send packets out on 412 00:20:18,060 --> 00:20:21,080 interfaces that don't have ARP entries for the IP that you're 413 00:20:21,080 --> 00:20:21,440 sending it to. 414 00:20:22,160 --> 00:20:23,680 It's the only challenge you've got. 415 00:20:23,860 --> 00:20:24,240 What's that? 416 00:20:24,620 --> 00:20:25,740 It's the only challenge you've got. 417 00:20:26,460 --> 00:20:28,300 Well, I mean, if you do it on a Cisco, I'm not going to be 418 00:20:28,300 --> 00:20:28,580 impressed. 419 00:20:33,000 --> 00:20:34,100 So yes, let's say. 420 00:20:37,380 --> 00:20:41,540 Yeah, so the idea is that effectively, the teams were 421 00:20:41,540 --> 00:20:43,880 walking, so we sat down at around 10, 11 o'clock on the 422 00:20:43,880 --> 00:20:45,940 first year we were doing this to try to figure this out. 423 00:20:46,340 --> 00:20:46,980 We're going. 424 00:20:47,100 --> 00:20:48,080 It's like 3 in the morning. 425 00:20:48,160 --> 00:20:50,080 We're like, jeez, we're supposed to start this thing 426 00:20:50,080 --> 00:20:50,420 at 10. 427 00:20:50,880 --> 00:20:51,420 It's still going. 428 00:20:51,420 --> 00:20:51,520 It's still going. 429 00:20:51,720 --> 00:20:52,680 7 in the morning. 430 00:20:53,320 --> 00:20:54,560 Sandwiches and Red Bulls come in. 431 00:20:55,420 --> 00:20:56,780 It's still not working. 432 00:20:57,660 --> 00:21:01,700 Eventually, the answer was to open up the FreeBSD kernel 433 00:21:01,700 --> 00:21:04,600 code, go into the ARP resolver, which is like this 434 00:21:04,600 --> 00:21:06,700 big, long routine of how to actually resolve ARP addresses 435 00:21:06,700 --> 00:21:10,520 properly, go past the local variable dex, dest adder sub 436 00:21:10,520 --> 00:21:15,300 0 equals 0xff semicolon, dest adder sub 1 equals 0xff 437 00:21:15,300 --> 00:21:18,840 semicolon, et cetera, through dest adder sub 5, until you're 438 00:21:18,840 --> 00:21:20,600 basically hard-coding in. 439 00:21:20,600 --> 00:21:22,560 So, for example, if I'm doing a broadcast ARP entry for 440 00:21:22,560 --> 00:21:25,380 every packet that's going to go through the machine, return. 441 00:21:27,100 --> 00:21:29,760 Make world, as the teams were walking in with equipment, 442 00:21:29,920 --> 00:21:31,680 make world, thing worked. 443 00:21:39,900 --> 00:21:42,520 Yeah, and then HJ takes the box home so that he can 444 00:21:42,520 --> 00:21:44,460 actually get, so that's where we're doing all of our packet 445 00:21:44,460 --> 00:21:46,340 dumps, like just TCP dumps so that we would have traffic 446 00:21:46,340 --> 00:21:48,700 logs, takes it home and ignorantly plugs it into his 447 00:21:48,700 --> 00:21:48,940 network. 448 00:21:50,120 --> 00:21:50,520 Everything. 449 00:21:50,520 --> 00:21:52,360 Everything goes nuts, because any time a packet hits that box, 450 00:21:52,460 --> 00:21:52,900 guess what happens? 451 00:21:53,040 --> 00:21:53,700 Eight more come out. 452 00:21:55,180 --> 00:21:59,980 So, yeah, it's a little ridiculous. 453 00:22:00,180 --> 00:22:03,100 So anyway, so that was the whole idea with that. 454 00:22:03,360 --> 00:22:07,940 So anyway, we eventually allowed inline servers in the 455 00:22:07,940 --> 00:22:09,180 last year that we did this. 456 00:22:09,300 --> 00:22:10,700 Actually, maybe even in the last two years. 457 00:22:11,320 --> 00:22:15,100 And that was kind of good for us, because we didn't have to 458 00:22:15,100 --> 00:22:16,000 hack a FreeBSD kernel. 459 00:22:17,640 --> 00:22:18,000 OK. 460 00:22:18,860 --> 00:22:19,220 So. 461 00:22:19,220 --> 00:22:21,340 So, the running of service polls. 462 00:22:21,580 --> 00:22:24,800 So, the service polls themselves, we actually wanted 463 00:22:24,800 --> 00:22:26,820 to make it so that they sort of look like normal traffic. 464 00:22:26,920 --> 00:22:28,540 Because if you can tell what a service poll looks like, you 465 00:22:28,540 --> 00:22:29,420 can pretty much game the game. 466 00:22:30,200 --> 00:22:32,260 So we had lots of randomization, both in the 467 00:22:32,260 --> 00:22:34,900 timing that the service poll would run, as well as the 468 00:22:34,900 --> 00:22:36,920 actual messages and the payloads that the service 469 00:22:36,920 --> 00:22:37,500 poll would deliver. 470 00:22:38,260 --> 00:22:40,680 And we didn't actually run service exploits from our 471 00:22:41,140 --> 00:22:41,780 service polls. 472 00:22:41,860 --> 00:22:43,540 We just made it look like someone was coming along and 473 00:22:43,540 --> 00:22:45,580 just poking at the service to see what it did. 474 00:22:45,940 --> 00:22:48,280 And I'll talk a little bit about some example services 475 00:22:48,280 --> 00:22:51,100 that we had, and that's kind of where we're going in this 476 00:22:51,100 --> 00:22:51,520 talk, eventually. 477 00:22:53,120 --> 00:22:55,160 So, yeah, freaking TTLs. 478 00:22:55,220 --> 00:22:57,680 So, the other thing that's kind of complicated, you 479 00:22:57,680 --> 00:23:00,080 remember, well, you may not remember, but the network 480 00:23:00,080 --> 00:23:02,220 diagram that I put up there a second ago, the polling server 481 00:23:02,220 --> 00:23:05,100 was away from where the rest of the team servers were, and 482 00:23:05,100 --> 00:23:06,880 away from where the rest of the networks were. 483 00:23:07,020 --> 00:23:09,660 As it turns out, the polling server is 484 00:23:09,660 --> 00:23:10,580 actually one hop closer. 485 00:23:11,360 --> 00:23:13,740 So if you don't actually go to all your infrastructure and 486 00:23:13,740 --> 00:23:16,660 adjust the TTLs via SysControls, then you can 487 00:23:16,660 --> 00:23:18,040 really easily tell where the polling 488 00:23:18,040 --> 00:23:20,220 server is coming from by just looking at the TTLs on the 489 00:23:20,220 --> 00:23:23,180 packets, because the TTL is going to be one higher for 490 00:23:23,620 --> 00:23:25,420 anything coming from the polling server, which is kind 491 00:23:25,420 --> 00:23:25,800 of a neat one. 492 00:23:26,200 --> 00:23:28,700 I think people actually found that out during the Ghetto 493 00:23:28,700 --> 00:23:30,100 years, like when Ghetto was running the game. 494 00:23:30,220 --> 00:23:31,680 The last year, we got a TTL firewall. 495 00:23:31,860 --> 00:23:34,780 Yeah, yeah, the last year, people had TTL firewalls up, 496 00:23:34,860 --> 00:23:35,360 which was kind of neat. 497 00:23:35,800 --> 00:23:37,620 The first couple years, it didn't really matter, because 498 00:23:37,620 --> 00:23:39,220 we didn't allow people to actually get inline. 499 00:23:39,460 --> 00:23:41,840 The first year we allowed people to get inline, we 500 00:23:41,840 --> 00:23:45,040 botched up the TTLs, and then fixed them pretty much after 501 00:23:45,040 --> 00:23:45,600 the game started. 502 00:23:45,980 --> 00:23:47,400 And then the last year, we finally got it right. 503 00:23:49,820 --> 00:23:57,040 OK, let's see, oh, yeah, service status, there we go. 504 00:23:58,060 --> 00:24:01,720 OK, so with service status, the way the Ghetto always ran 505 00:24:01,720 --> 00:24:04,380 the game was that they would not tell you what the service 506 00:24:04,380 --> 00:24:04,720 status was. 507 00:24:04,800 --> 00:24:07,540 They would just give you a vague idea of about how many of 508 00:24:07,540 --> 00:24:09,380 your services were up, as kind of a rough percentage. 509 00:24:09,500 --> 00:24:12,200 So you'd be able to say, oh, we got about 80% there. 510 00:24:13,280 --> 00:24:16,200 And then when we were running the game, we tried to kind of 511 00:24:16,200 --> 00:24:17,840 carry on that same idea, at least the first couple 512 00:24:17,840 --> 00:24:18,020 years. 513 00:24:18,640 --> 00:24:21,380 And as it turns out, all that really causes is every team to 514 00:24:21,380 --> 00:24:23,520 have a gopher that comes up and asks what services are up. 515 00:24:23,680 --> 00:24:26,380 Like, oh, is the ABC service up? 516 00:24:26,440 --> 00:24:27,300 Is the bar service up? 517 00:24:28,420 --> 00:24:29,140 OK, sure. 518 00:24:30,160 --> 00:24:31,440 So that got really annoying. 519 00:24:31,560 --> 00:24:34,220 So we ended up just kind of giving teams the exact info 520 00:24:34,220 --> 00:24:36,080 that we had on the latest service polls. 521 00:24:36,240 --> 00:24:37,460 So we did that in the last two years. 522 00:24:37,620 --> 00:24:39,020 It turned out that works out really well. 523 00:24:39,100 --> 00:24:41,600 So that way, teams can kind of self-service, less running 524 00:24:41,600 --> 00:24:44,120 around and a little bit more of concentrating on actually 525 00:24:44,120 --> 00:24:45,940 playing the game, reverse engineering, and hacking into 526 00:24:45,940 --> 00:24:47,500 the challenges that we present, which is good. 527 00:24:49,200 --> 00:24:52,340 Just a couple of technology highlights from the years we've 528 00:24:52,340 --> 00:24:52,680 done this. 529 00:24:52,760 --> 00:24:54,920 We have well over a million lines of code that's checked 530 00:24:54,920 --> 00:24:56,760 into our repository for actually running this game, 531 00:24:56,940 --> 00:24:58,820 which is kind of retarded, if you think about it. 532 00:24:59,820 --> 00:25:02,520 And then we actually have a huge amount of reusable 533 00:25:02,520 --> 00:25:03,040 infrastructure. 534 00:25:03,260 --> 00:25:05,080 So the standard progression, I kind of joke about this, 535 00:25:05,180 --> 00:25:06,900 because it happened with Ghetto, too, at least for the 536 00:25:06,900 --> 00:25:07,380 first year. 537 00:25:07,440 --> 00:25:08,260 They ran it for three years. 538 00:25:08,600 --> 00:25:09,520 We ran it for four. 539 00:25:09,600 --> 00:25:12,640 But for the first year, your team is so gung-ho to go and 540 00:25:12,640 --> 00:25:14,920 run CTF that you just knock it out of the park. 541 00:25:15,200 --> 00:25:16,740 Like, you have everybody working together. 542 00:25:16,740 --> 00:25:17,540 Everything is streamlined. 543 00:25:18,320 --> 00:25:20,220 Year two, you're like, oh, that shit was easy. 544 00:25:20,420 --> 00:25:21,260 We got this down. 545 00:25:22,080 --> 00:25:22,400 Disaster. 546 00:25:23,100 --> 00:25:25,540 Year two, it wasn't a complete disaster, but there was 547 00:25:25,540 --> 00:25:26,260 definitely a lot of headaches. 548 00:25:26,400 --> 00:25:28,840 We spent a lot of time running around and a lot of time 549 00:25:28,840 --> 00:25:29,960 wondering what the hell we did wrong. 550 00:25:30,220 --> 00:25:32,760 Year three, you have to do it, because no one wants to go 551 00:25:32,760 --> 00:25:33,420 out like a chump, right? 552 00:25:33,500 --> 00:25:35,940 So you've got to do year three properly. 553 00:25:36,140 --> 00:25:39,260 And then that's when we really put a lot of time into making 554 00:25:39,260 --> 00:25:40,940 game infrastructure completely rock solid. 555 00:25:41,160 --> 00:25:43,320 And then so for year four, we basically picked the same 556 00:25:43,320 --> 00:25:45,700 pieces of infrastructure up that we had, were able to use 557 00:25:45,700 --> 00:25:46,460 them, and just effectively 558 00:25:46,460 --> 00:25:48,960 had to recode a lot of challenges and things like 559 00:25:48,960 --> 00:25:50,220 that, and just invent some new challenges. 560 00:25:50,360 --> 00:25:51,700 But the infrastructure itself was stable, 561 00:25:51,820 --> 00:25:52,380 which was kind of cool. 562 00:25:53,500 --> 00:25:55,440 The other thing to consider is that we actually build two 563 00:25:55,440 --> 00:25:57,800 games every year, because running quals is basically a 564 00:25:57,800 --> 00:25:58,580 whole separate adventure. 565 00:25:59,420 --> 00:26:01,460 The way we've set up quals, I don't know if you guys have 566 00:26:01,460 --> 00:26:03,600 ever played in it or seen it, it's sort of set up like a 567 00:26:03,600 --> 00:26:04,080 Jeopardy board. 568 00:26:04,240 --> 00:26:06,780 So you have, I think, what, five categories times five 569 00:26:06,780 --> 00:26:07,440 questions each. 570 00:26:07,540 --> 00:26:08,600 So there are about 25 challenges. 571 00:26:08,720 --> 00:26:10,860 They get harder, much like in Jeopardy, as you go down for 572 00:26:10,860 --> 00:26:11,880 more points. 573 00:26:13,180 --> 00:26:15,480 And they cover a few different types of categories and things 574 00:26:15,480 --> 00:26:15,780 like that. 575 00:26:15,820 --> 00:26:16,080 But that's 576 00:26:16,080 --> 00:26:17,140 basically completely separate. 577 00:26:17,320 --> 00:26:19,100 All that does is figure out who gets to actually show up 578 00:26:19,100 --> 00:26:19,300 here. 579 00:26:19,560 --> 00:26:21,820 And then when we actually run the game here, it's a 580 00:26:21,820 --> 00:26:23,940 completely new set of challenges, completely 581 00:26:23,940 --> 00:26:24,680 different kind of game. 582 00:26:27,400 --> 00:26:29,700 Oh yeah, the other thing that was built along the way was 583 00:26:29,700 --> 00:26:32,560 that we really were doing a lot of our back-end 584 00:26:32,560 --> 00:26:34,680 infrastructure, most of it's almost entirely in Python. 585 00:26:35,640 --> 00:26:38,760 And we just were unsatisfied with other Python remoting 586 00:26:38,760 --> 00:26:41,640 libraries that were out there, so Invisigoth basically 587 00:26:41,640 --> 00:26:43,260 built his own, which is kind of neat. 588 00:26:43,360 --> 00:26:44,700 And it works incredibly well. 589 00:26:44,700 --> 00:26:48,200 And we actually had custom harnesses that we wrote. 590 00:26:48,300 --> 00:26:50,420 Because when you're writing challenges for so long, you 591 00:26:50,420 --> 00:26:53,480 don't really want to write the same routine to drop privs or to 592 00:26:53,840 --> 00:26:56,420 do whatever rudimentary functions that you need in just 593 00:26:56,420 --> 00:26:58,820 writing a service to do obfuscation, which we'll talk 594 00:26:58,820 --> 00:26:59,220 about in a second. 595 00:26:59,420 --> 00:27:01,960 So we had a bunch of custom harnesses that we wrote to make 596 00:27:01,960 --> 00:27:04,280 writing services and writing challenges pretty easy. 597 00:27:04,340 --> 00:27:06,400 And it was pretty funny because a lot of the guys, I didn't 598 00:27:06,400 --> 00:27:08,460 participate, but a lot of the guys just kind of poked around 599 00:27:08,460 --> 00:27:10,740 during quals when DD Tech was running, the guys that are 600 00:27:10,740 --> 00:27:11,280 doing it this year. 601 00:27:11,560 --> 00:27:13,640 And we just did a little bit of poking around in some of the 602 00:27:13,640 --> 00:27:14,680 binaries. And they were using them. So it was a lot of fun. 603 00:27:14,680 --> 00:27:16,660 Our service infrastructure, our service harness, which is 604 00:27:16,660 --> 00:27:16,960 kind of neat. 605 00:27:17,180 --> 00:27:18,680 I don't know how the hell they got it, but yeah. 606 00:27:20,960 --> 00:27:21,600 So yeah. 607 00:27:23,900 --> 00:27:24,220 OK. 608 00:27:24,520 --> 00:27:27,180 So let's talk about some of the actual challenges that 609 00:27:27,180 --> 00:27:27,680 were in the game. 610 00:27:28,160 --> 00:27:32,000 So I talked to some of the guys. 611 00:27:32,140 --> 00:27:33,840 And we kind of picked some of the ones that we thought were 612 00:27:33,840 --> 00:27:35,940 some of the more fun ones, some of the more insane ones 613 00:27:35,940 --> 00:27:38,780 to have to actually beat. 614 00:27:39,800 --> 00:27:42,260 And so hopefully you'll enjoy what we talk about here. 615 00:27:42,380 --> 00:27:44,220 So some of the general things that we did. 616 00:27:44,740 --> 00:27:47,120 Just to kind of frustrate people, and to make it more 617 00:27:47,120 --> 00:27:49,000 challenging, was that we always strip symbols. 618 00:27:49,100 --> 00:27:50,760 There's no point in having symbols in it, because if you 619 00:27:50,760 --> 00:27:52,580 can reverse engineer, you don't need no stinking symbols. 620 00:27:53,780 --> 00:27:56,940 And then we had a bunch of macros that we used to make 621 00:27:56,940 --> 00:27:59,000 things just kind of screwy when you would open it up in 622 00:27:59,000 --> 00:27:59,880 a disassembler. 623 00:28:00,220 --> 00:28:02,780 So one of the favorite ones was that we would have jumps into 624 00:28:02,780 --> 00:28:04,520 the middle of what, you know, if you just opened it up and 625 00:28:04,520 --> 00:28:06,280 eyed it and looked at it, you would see a couple of 626 00:28:06,280 --> 00:28:07,820 instructions, and eventually you'd get the one that's 627 00:28:07,820 --> 00:28:09,460 like, what does that instruction do? 628 00:28:09,580 --> 00:28:11,520 And you scratch your head for a while until you realize it 629 00:28:11,520 --> 00:28:12,080 doesn't do anything. 630 00:28:12,180 --> 00:28:12,920 It's not actually an instruction. 631 00:28:13,900 --> 00:28:14,400 Because it 632 00:28:14,400 --> 00:28:18,140 actually is you jump into the code at a weird offset, so a 633 00:28:18,140 --> 00:28:20,480 couple byte offset, so that you're actually executing sort 634 00:28:20,480 --> 00:28:22,320 of not in the same way that a disassembler would. 635 00:28:22,440 --> 00:28:25,040 So you just have to kind of reset things in order to 636 00:28:25,040 --> 00:28:27,080 reverse engineer it properly, which is kind of neat. 637 00:28:27,540 --> 00:28:29,100 So it kind of messes up disassemblers. 638 00:28:29,680 --> 00:28:32,060 In a lot of the challenges that we had, we would filter 639 00:28:32,060 --> 00:28:33,200 for common shellcode characters. 640 00:28:33,360 --> 00:28:34,860 So you would have to actually write your own shellcode. 641 00:28:34,960 --> 00:28:36,820 You can't just go pull it out all off one's paper and try to 642 00:28:36,820 --> 00:28:37,100 use it. 643 00:28:37,120 --> 00:28:37,580 Not going to work. 644 00:28:39,040 --> 00:28:41,720 And then so those are some of the common characters, so 645 00:28:41,720 --> 00:28:43,120 just FFCVs, that kind of thing. 646 00:28:44,220 --> 00:28:47,000 So yeah, and then let's see, let's talk about some of the 647 00:28:47,000 --> 00:28:47,660 specific challenges. 648 00:28:47,780 --> 00:28:49,220 We'll start with one of the favorite ones. 649 00:28:49,300 --> 00:28:50,340 At least it's one of our favorite ones. 650 00:28:50,440 --> 00:28:53,460 You may think this is a little stupid, but this is what the 651 00:28:53,460 --> 00:28:53,880 challenge was. 652 00:28:53,940 --> 00:28:54,780 And let's see if the audio works. 653 00:28:59,260 --> 00:29:02,080 So the challenge was basically, you've got to listen to this 654 00:29:02,080 --> 00:29:04,660 WAV file and tell us the name of the BBS that's actually 655 00:29:04,660 --> 00:29:05,560 being discussed in it. 656 00:29:06,720 --> 00:29:09,980 Echelon intercept number 1337 stroke B. 657 00:29:12,240 --> 00:29:13,320 All right, cool. 658 00:29:13,480 --> 00:29:14,680 I got the password file. 659 00:29:14,820 --> 00:29:16,180 I'm going to upload it to the BBS now. 660 00:29:20,800 --> 00:29:21,240 . 661 00:29:21,240 --> 00:29:21,800 . 662 00:29:21,800 --> 00:29:21,860 . 663 00:29:23,220 --> 00:29:23,660 . 664 00:29:37,320 --> 00:29:37,760 . 665 00:29:37,760 --> 00:29:38,020 . 666 00:29:38,020 --> 00:29:38,080 . 667 00:29:38,080 --> 00:29:38,180 . 668 00:29:39,520 --> 00:29:39,960 . 669 00:29:39,980 --> 00:29:40,240 . 670 00:29:40,860 --> 00:29:41,220 . 671 00:29:41,380 --> 00:29:43,460 As it turns out, we couldn't actually find a damn modem. 672 00:29:47,280 --> 00:29:50,040 So we all sat around Metro's living room with his 673 00:29:50,040 --> 00:29:52,400 girlfriend looking at us like we had seven heads and we just 674 00:29:52,400 --> 00:29:53,440 lost our minds entirely. 675 00:29:53,980 --> 00:29:56,600 And Bob was sitting there with his laptop trying to record it 676 00:29:56,600 --> 00:29:57,560 because we didn't have a microphone, either. 677 00:30:00,020 --> 00:30:00,740 We were 678 00:30:10,360 --> 00:30:12,820 So that was, again, that one's not so difficult, right? 679 00:30:13,000 --> 00:30:15,060 DTMF, then do some Googling, you'll figure it out. 680 00:30:16,620 --> 00:30:17,720 Okay, next one. 681 00:30:18,000 --> 00:30:19,360 This one was called Goes to 11, 682 00:30:19,600 --> 00:30:22,400 which was basically a very simple program. 683 00:30:22,600 --> 00:30:24,260 It just was a network listener, opened up a socket, 684 00:30:24,480 --> 00:30:25,960 it allowed you to send some data, 685 00:30:26,060 --> 00:30:29,960 and then it would basically just cast that data to a void star 686 00:30:29,960 --> 00:30:32,100 and then invoke it like it was a function. 687 00:30:32,240 --> 00:30:34,200 Except you only got 10 bytes to work with, 688 00:30:34,340 --> 00:30:35,940 which is actually pretty challenging. 689 00:30:36,580 --> 00:30:39,780 So you have to figure out 10 bytes of, you know, 690 00:30:39,780 --> 00:30:41,180 of basically opcode that will actually 691 00:30:42,660 --> 00:30:44,340 basically make a remote exploit. 692 00:30:45,400 --> 00:30:47,040 So a bunch of people solved it, 693 00:30:47,120 --> 00:30:49,700 but we ended up getting it down to 8 bytes. 694 00:30:49,800 --> 00:30:51,600 And I think one of the other teams that was playing 695 00:30:51,600 --> 00:30:52,620 actually got that as well, 696 00:30:52,740 --> 00:30:54,740 but that's about as small as it can get, 697 00:30:54,780 --> 00:30:55,580 as near as we can tell. 698 00:30:55,680 --> 00:30:57,000 But that was another fun one. 699 00:30:57,080 --> 00:30:59,800 So that was, again, sort of basic, pretty simple. 700 00:31:03,020 --> 00:31:03,340 Okay. 701 00:31:04,900 --> 00:31:05,900 The TNICS service. 702 00:31:06,960 --> 00:31:09,540 This one was one where it would prompt you for a password. 703 00:31:09,780 --> 00:31:12,040 Which was basically just straightforward brute forcing. 704 00:31:12,500 --> 00:31:14,060 Except it would actually drop your connection 705 00:31:14,060 --> 00:31:15,780 as soon as you put the wrong character in. 706 00:31:15,960 --> 00:31:17,900 So if you just grabbed a password brooder 707 00:31:17,900 --> 00:31:19,020 and started running it against it, 708 00:31:19,080 --> 00:31:20,100 it was going to take a long time. 709 00:31:20,940 --> 00:31:22,360 So you would actually have to write, like, 710 00:31:22,360 --> 00:31:23,940 either your own custom brooder to do it, 711 00:31:24,000 --> 00:31:25,920 or you would have to, you know, do it by hand, 712 00:31:25,980 --> 00:31:27,560 which pretty much everyone just wrote a custom brooder. 713 00:31:28,340 --> 00:31:30,000 So that was another one that was, again, 714 00:31:30,040 --> 00:31:30,660 pretty straightforward. 715 00:31:31,720 --> 00:31:34,100 So those are the easy ones that I covered so far. 716 00:31:34,960 --> 00:31:37,300 Let's talk about one that nobody figured out. 717 00:31:38,180 --> 00:31:39,320 We called it math is hard. 718 00:31:39,320 --> 00:31:39,960 I don't know if you noticed, 719 00:31:40,040 --> 00:31:40,980 but we name all of our services 720 00:31:40,980 --> 00:31:42,940 after just whatever we happened to be thinking of at the time. 721 00:31:43,380 --> 00:31:44,700 So the math is hard service 722 00:31:45,540 --> 00:31:47,220 actually did waveform analysis. 723 00:31:47,360 --> 00:31:49,960 So it did an FFT of whatever the input file was. 724 00:31:50,860 --> 00:31:52,700 And if it received the correct input 725 00:31:52,700 --> 00:31:54,000 for whatever the correct input was, 726 00:31:54,160 --> 00:31:55,540 it would actually give up the key. 727 00:31:55,640 --> 00:31:57,120 And it would just hand it to you. 728 00:31:57,500 --> 00:31:59,380 Which doesn't seem like it would be that hard. 729 00:31:59,480 --> 00:32:00,460 Perhaps you could reverse engineer 730 00:32:00,840 --> 00:32:02,120 all the math that goes into that. 731 00:32:02,520 --> 00:32:05,080 Except we went in and changed it 732 00:32:05,080 --> 00:32:06,980 so that there was no more than just a couple of instructions 733 00:32:07,380 --> 00:32:08,320 before there was a jump. 734 00:32:08,740 --> 00:32:09,300 So if you had a couple of instructions, 735 00:32:09,300 --> 00:32:10,640 and you actually try to open it up in IDA, 736 00:32:10,720 --> 00:32:11,680 it just explodes. 737 00:32:12,020 --> 00:32:14,120 It says that there's just too many branches 738 00:32:14,120 --> 00:32:16,420 for it to actually do a control flow graph for you. 739 00:32:16,980 --> 00:32:18,360 Which makes it really hard. 740 00:32:18,480 --> 00:32:19,960 Because then you have to sit there 741 00:32:19,960 --> 00:32:22,120 and reverse engineer a huge amount 742 00:32:22,120 --> 00:32:24,020 of mathematical operations that are basically 743 00:32:24,020 --> 00:32:25,180 like two instructions jump. 744 00:32:26,280 --> 00:32:27,240 Two instructions jump. 745 00:32:28,420 --> 00:32:28,860 What? 746 00:32:29,040 --> 00:32:30,800 It becomes a bit of a mess. 747 00:32:31,320 --> 00:32:34,380 And the right answer was the theme to... 748 00:32:39,500 --> 00:32:41,540 If you actually fed it that file, it would work. 749 00:32:42,620 --> 00:32:44,460 Yeah, which was kind of a crazy one. 750 00:32:44,560 --> 00:32:46,860 So just to give you an idea of what it sort of looked like. 751 00:32:46,920 --> 00:32:48,300 I won't make you stare at this for too long 752 00:32:48,300 --> 00:32:50,600 because it might scare people with it running out of the room. 753 00:32:50,900 --> 00:32:52,060 And you probably can't read it either. 754 00:32:52,140 --> 00:32:52,860 So that works out. 755 00:32:54,800 --> 00:32:58,960 So the idea was that, well, effectively what you see 756 00:32:58,960 --> 00:33:00,880 at the top are just a couple of instructions that, 757 00:33:00,960 --> 00:33:02,980 and that's what it looks like if you just open it up into IDA. 758 00:33:03,700 --> 00:33:07,140 But once you actually undo some of the jumping around madness, 759 00:33:07,740 --> 00:33:09,020 it's actually very, very simple. 760 00:33:09,300 --> 00:33:11,440 You just have a move, a comp, and a jump. 761 00:33:12,000 --> 00:33:14,060 And then the rest of the stuff that's after it 762 00:33:14,060 --> 00:33:15,060 just is totally meaningless. 763 00:33:15,200 --> 00:33:16,260 It doesn't really do much of anything 764 00:33:16,260 --> 00:33:17,360 because it doesn't execute. 765 00:33:18,060 --> 00:33:19,420 So that was a simple one. 766 00:33:19,480 --> 00:33:20,160 Well, not a simple one. 767 00:33:20,160 --> 00:33:21,100 That was actually a very hard one. 768 00:33:21,680 --> 00:33:23,940 And I don't think anyone actually busted that one, did they? 769 00:33:24,020 --> 00:33:24,320 No? 770 00:33:24,840 --> 00:33:25,200 No? 771 00:33:26,180 --> 00:33:26,920 So, yeah. 772 00:33:27,200 --> 00:33:27,560 Okay. 773 00:33:29,300 --> 00:33:31,600 Let's talk about the next one. 774 00:33:32,500 --> 00:33:32,860 Morse. 775 00:33:34,080 --> 00:33:35,840 So we had input. 776 00:33:35,960 --> 00:33:38,500 So it just would read whatever input you handed it 777 00:33:38,500 --> 00:33:39,140 and ask, 778 00:33:39,300 --> 00:33:39,520 or whatever. 779 00:33:40,740 --> 00:33:42,900 And there was no overflow in that part of it. 780 00:33:43,020 --> 00:33:44,760 But then it converted it into Morse code, 781 00:33:44,920 --> 00:33:46,040 into ASCII Morse code, 782 00:33:46,100 --> 00:33:47,760 dots, dashes, spaces. 783 00:33:48,360 --> 00:33:51,260 And then that was where the stack overflow occurred, 784 00:33:51,360 --> 00:33:52,560 once it was converted to Morse. 785 00:33:52,880 --> 00:33:55,200 So you had to actually write your exploit 786 00:33:55,200 --> 00:33:56,740 using those three bytes. 787 00:33:58,140 --> 00:34:00,060 You had to write a Morse code payload, 788 00:34:00,260 --> 00:34:01,280 which is pretty awesome, actually. 789 00:34:04,300 --> 00:34:06,540 And people did break this one. 790 00:34:06,660 --> 00:34:07,900 I think a number of people did. 791 00:34:09,300 --> 00:34:09,940 Yeah, which is pretty cool. 792 00:34:10,640 --> 00:34:13,240 Kind of a fun one that we threw in there, but yeah. 793 00:34:13,380 --> 00:34:15,460 So hopefully you're getting a feel 794 00:34:15,460 --> 00:34:16,560 for some of the challenges we made. 795 00:34:16,620 --> 00:34:18,320 We didn't just try to find an old bind exploit 796 00:34:18,320 --> 00:34:19,100 and throw it on the box. 797 00:34:19,180 --> 00:34:20,800 We tried to make some inventive stuff 798 00:34:20,800 --> 00:34:23,440 that would cause people's little bit of head scratching, 799 00:34:23,520 --> 00:34:23,740 I guess. 800 00:34:24,220 --> 00:34:24,900 Eyeballs to bleed. 801 00:34:25,400 --> 00:34:26,500 Eyeballs to bleed as well, yes. 802 00:34:28,360 --> 00:34:30,840 Okay, let's talk about the next one. 803 00:34:31,780 --> 00:34:32,100 Neuromancer. 804 00:34:33,340 --> 00:34:35,400 This program, basically when you looked at it, 805 00:34:35,420 --> 00:34:38,640 if you opened it up into IDA, it just looked like one giant, 806 00:34:38,640 --> 00:34:40,320 giant knob sled, and that's it. 807 00:34:40,360 --> 00:34:42,440 It was just a whole bunch of knobs, okay? 808 00:34:43,080 --> 00:34:43,900 Not that interesting. 809 00:34:44,740 --> 00:34:47,220 Except you could pass it precisely one byte of input, 810 00:34:47,380 --> 00:34:49,680 and then depending on that byte of input that you passed it, 811 00:34:49,760 --> 00:34:53,640 it would actually go to some random place 812 00:34:53,640 --> 00:34:55,360 that was in the data defined in the program, 813 00:34:55,440 --> 00:34:56,320 so something in the data segment, 814 00:34:56,460 --> 00:34:57,860 and it wasn't entirely random. 815 00:34:57,920 --> 00:34:58,840 There was some calculation to it. 816 00:34:59,100 --> 00:35:01,720 And then it would actually XOR the entire knob sled 817 00:35:01,720 --> 00:35:03,780 with whatever was found at that data segment, 818 00:35:03,900 --> 00:35:07,660 or at that offset, and then it would jump to that spot 819 00:35:07,660 --> 00:35:10,360 after it XORed the knob sled, and then execute it from there. 820 00:35:10,760 --> 00:35:14,500 And one such byte actually led to a exploitable condition, 821 00:35:14,700 --> 00:35:15,640 so you have to find the right byte, 822 00:35:16,000 --> 00:35:16,980 and then you had to do it, 823 00:35:17,040 --> 00:35:18,620 and then you had to figure out where the exploit was in the code 824 00:35:18,620 --> 00:35:19,900 after it's XORed with the knob sled. 825 00:35:20,340 --> 00:35:22,140 Then you had to go back and write the exploit for it. 826 00:35:23,200 --> 00:35:23,700 Pretty neat. 827 00:35:23,940 --> 00:35:24,140 Easy. 828 00:35:24,520 --> 00:35:24,840 Yeah. 829 00:35:27,380 --> 00:35:28,020 Pretty neat. 830 00:35:28,560 --> 00:35:31,120 So I have, shocking. 831 00:35:31,700 --> 00:35:34,300 This is what it looks like when you open it up in a disassembler. 832 00:35:34,840 --> 00:35:35,780 Push, move, knob. 833 00:35:37,660 --> 00:35:40,200 And then you can see the graph overview is very insightful. 834 00:35:41,840 --> 00:35:42,200 Yeah. 835 00:35:42,580 --> 00:35:42,940 So. 836 00:35:43,800 --> 00:35:44,160 So. 837 00:35:44,980 --> 00:35:45,340 Yeah. 838 00:35:46,780 --> 00:35:50,320 And that's what the data that was defined in the program looked like, 839 00:35:50,400 --> 00:35:54,520 which if you tried to look at this data directly, 840 00:35:54,700 --> 00:35:56,640 it didn't really mean anything because it's all XORed with knobs. 841 00:35:57,080 --> 00:35:59,040 So you would have to actually kind of figure out 842 00:35:59,040 --> 00:36:01,260 what the hell was going on before you would even be able to decode 843 00:36:01,260 --> 00:36:01,800 what was in here. 844 00:36:02,040 --> 00:36:04,500 Then, I mean, just imagine it from a reverser's perspective, right? 845 00:36:04,760 --> 00:36:06,400 You don't know what the right byte offset is. 846 00:36:06,460 --> 00:36:07,000 We just picked one. 847 00:36:07,660 --> 00:36:08,900 And then put the right code in the right place. 848 00:36:08,920 --> 00:36:10,500 And the rest was just kind of other random garbage. 849 00:36:11,660 --> 00:36:14,500 But if you didn't know that, you would have to effectively go through 850 00:36:15,260 --> 00:36:18,340 and run a knobs XOR against this entire big chunk of data. 851 00:36:18,800 --> 00:36:22,500 And then inside there, figure out what bytes led to what offsets 852 00:36:22,500 --> 00:36:23,480 into that big chunk of data. 853 00:36:23,740 --> 00:36:26,400 And then from there, figure out which ones were actually going to execute 854 00:36:26,400 --> 00:36:27,180 and how it was going to execute. 855 00:36:27,340 --> 00:36:29,020 So you effectively had to reverse this giant chunk. 856 00:36:29,320 --> 00:36:31,600 And then you had to figure out which one you actually wanted to use 857 00:36:31,600 --> 00:36:33,500 with the exploitable condition, which is a lot of work. 858 00:36:34,740 --> 00:36:36,720 It's a lot easier to write these, I guess, than to exploit them. 859 00:36:39,600 --> 00:36:43,900 But just to be fair, and just so I've said it, we've tested every single one 860 00:36:43,900 --> 00:36:47,040 of these exploits that we put in there to make sure that they're actually exploitable. 861 00:36:47,420 --> 00:36:50,100 Well, maybe not every single one, but I'm pretty sure every single one. 862 00:36:50,620 --> 00:36:51,620 I think every single one. 863 00:36:51,660 --> 00:36:52,400 Yeah, every single one. 864 00:36:52,540 --> 00:36:53,540 I stand by my story. 865 00:36:56,560 --> 00:36:56,920 Okay. 866 00:36:59,120 --> 00:37:04,840 Then we get to menage a trois. 867 00:37:06,720 --> 00:37:08,160 And this one was just such a pain in the ass. 868 00:37:08,200 --> 00:37:10,980 I think only one person actually figured this one out. 869 00:37:11,600 --> 00:37:13,540 There's three processes that would all fire up. 870 00:37:13,800 --> 00:37:16,360 And they would attach as debuggers to each other. 871 00:37:17,080 --> 00:37:20,120 Which no real, I mean, no kernel's going to let you do that, 872 00:37:20,140 --> 00:37:21,640 and no machine's going to let you do that. 873 00:37:21,720 --> 00:37:24,700 So we have to patch the kernel a little bit to allow a debugging loop. 874 00:37:26,280 --> 00:37:29,100 And then we did that, which was fine. 875 00:37:29,340 --> 00:37:30,700 So all these things are now attached. 876 00:37:30,840 --> 00:37:33,020 You've got three services that are all hooked up to each other as debuggers. 877 00:37:33,980 --> 00:37:36,700 So the actual code that was inside each of these, you know, we had to make sure that 878 00:37:36,720 --> 00:37:38,620 each of these is, it was all encrypted. 879 00:37:39,700 --> 00:37:43,060 So all you had was a bit of a stub program that would fire up and do the attaching and 880 00:37:43,060 --> 00:37:43,440 all that stuff. 881 00:37:43,660 --> 00:37:47,160 And all the rest of the tech segment in terms of the code that was defined in it was all 882 00:37:47,160 --> 00:37:47,540 encrypted. 883 00:37:47,860 --> 00:37:51,240 So you really couldn't just fire up one of the programs and try to do anything with it 884 00:37:51,240 --> 00:37:53,580 because the keys to decrypt it weren't in there. 885 00:37:53,600 --> 00:37:54,480 They were in one of the other programs. 886 00:37:55,540 --> 00:38:00,960 So the way it ended up sort of working was that one of the programs would fire a signal. 887 00:38:01,780 --> 00:38:04,640 The debugger that was attached, one of the three programs that was attached to it, its 888 00:38:04,640 --> 00:38:05,900 neighbor, would catch it. 889 00:38:05,900 --> 00:38:11,040 Then run a decryption on one of its, you know, segments of code, execute it, and then sort 890 00:38:11,040 --> 00:38:11,580 of re-encrypt it. 891 00:38:11,660 --> 00:38:15,140 So you never actually had anything that was sitting around unencrypted. 892 00:38:15,300 --> 00:38:18,720 And the tricky thing about it is that statically decompiling it and trying to figure it out 893 00:38:18,720 --> 00:38:19,260 just doesn't work. 894 00:38:19,380 --> 00:38:22,560 You have to do it in memory because otherwise you don't really have all the context that 895 00:38:22,560 --> 00:38:25,640 you need for what signal got fired and what was, you know, what was the message and so 896 00:38:25,640 --> 00:38:25,860 forth. 897 00:38:26,880 --> 00:38:27,680 Which is pretty cool. 898 00:38:29,080 --> 00:38:34,820 So just an idea of what that looks like when you fire it up in a disassembler is that 899 00:38:34,820 --> 00:38:35,880 you really just have a few instructions. 900 00:38:35,880 --> 00:38:37,420 And the rest just kind of looks like garbage. 901 00:38:37,760 --> 00:38:40,020 Because all that stuff is actually code. 902 00:38:40,380 --> 00:38:44,580 Well it looks like data, but it's actually code after you decrypt it. 903 00:38:47,000 --> 00:38:47,320 Yeah. 904 00:38:47,420 --> 00:38:49,320 So that was Menage a Trois. 905 00:38:51,600 --> 00:38:54,660 And then, yeah, there was one guy that actually got that one. 906 00:38:54,740 --> 00:38:56,960 And this one has, I think, got to be my favorite of all of them. 907 00:38:57,780 --> 00:38:59,320 Because this one was just so ridiculous. 908 00:38:59,700 --> 00:39:01,220 This was the one that we actually had in year one. 909 00:39:01,620 --> 00:39:02,760 It was a daemon that was listening. 910 00:39:02,880 --> 00:39:04,280 And so if you were just watching network traffic. 911 00:39:04,900 --> 00:39:10,160 It effectively looked like the thing just received basically an excerpt from Alice 912 00:39:10,160 --> 00:39:10,740 in Wonderland. 913 00:39:11,020 --> 00:39:14,560 And then the return that it would send was basically the same excerpt with some things 914 00:39:14,560 --> 00:39:15,720 capitalized and so forth. 915 00:39:15,840 --> 00:39:17,580 So it would just be like, you know, changed around a little bit. 916 00:39:19,100 --> 00:39:20,740 So that's from a network perspective. 917 00:39:21,360 --> 00:39:26,420 When you would actually kind of look at the payload itself, you know, the message that 918 00:39:26,420 --> 00:39:30,760 was being sent, it was the excerpt from Alice in Wonderland followed by a relatively unusual 919 00:39:30,760 --> 00:39:31,740 amount of white space. 920 00:39:32,520 --> 00:39:33,960 So as it turns out. 921 00:39:33,960 --> 00:39:36,200 The white space actually was the meaningful part of the message. 922 00:39:36,720 --> 00:39:39,280 A tab was a one and a space was a zero. 923 00:39:39,800 --> 00:39:43,740 And then using that method, you can interpret what all the white space was following the 924 00:39:43,740 --> 00:39:45,660 last valid character or the last actual character. 925 00:39:47,760 --> 00:39:52,320 Once you actually convert that into binary, then you have to kind of figure out what that 926 00:39:52,320 --> 00:39:52,460 is. 927 00:39:52,540 --> 00:39:55,300 So now you have to start like looking into the daemon itself to try to reverse what the 928 00:39:55,300 --> 00:39:55,760 hell is it doing. 929 00:39:56,520 --> 00:40:02,020 And what it actually is, is they were opcodes and operands in an instruction set that we 930 00:40:02,020 --> 00:40:02,440 just made up. 931 00:40:04,000 --> 00:40:07,360 And it was basically the instruction set for a chip set that we just made up. 932 00:40:08,000 --> 00:40:10,200 And there were hundreds of operations in there. 933 00:40:10,280 --> 00:40:12,820 I mean, this thing was like, it was a full blown VM for anything. 934 00:40:13,060 --> 00:40:15,060 I mean, you couldn't really do that many useful things with it. 935 00:40:15,380 --> 00:40:17,360 But it was a hell of a thing to have to reverse engineer. 936 00:40:17,540 --> 00:40:21,620 I mean, imagine trying to figure out how to actually reverse engineer some opcodes 937 00:40:21,620 --> 00:40:24,260 in some machine language that you've never even seen before and you have no reference 938 00:40:24,260 --> 00:40:24,420 to. 939 00:40:24,480 --> 00:40:25,240 We just created the thing. 940 00:40:26,760 --> 00:40:32,200 And to actually exploit it, you have to write your exploit in the language that we made 941 00:40:32,200 --> 00:40:32,460 up. 942 00:40:32,460 --> 00:40:36,640 You have to actually write it based on, you know, your shellcode had to be written with 943 00:40:36,640 --> 00:40:39,820 the opcodes and the operands and so forth in our made up language. 944 00:40:40,440 --> 00:40:41,880 Which is just bonkers. 945 00:40:42,120 --> 00:40:47,100 And there was one guy, Chris Eagle, who actually figured this damn thing out. 946 00:40:47,300 --> 00:40:53,280 And he rolls in on Sunday morning, I wrote you an interpreter for your stupid language. 947 00:40:58,760 --> 00:40:59,200 Unbelievable. 948 00:40:59,740 --> 00:41:01,660 It was by far one of those moments where you're like. 949 00:41:02,000 --> 00:41:02,440 . . 950 00:41:04,260 --> 00:41:32,380 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 951 00:41:32,380 --> 00:41:35,860 challenges, is you write something that looks tasty and fun for one rock star. 952 00:41:36,860 --> 00:41:37,580 You know why? 953 00:41:38,740 --> 00:41:42,420 Because he's stuck on it for three days going, God! 954 00:41:44,060 --> 00:41:48,500 So it makes it fun to put out something tasty and juicy for one rock star to spend his life 955 00:41:48,860 --> 00:41:52,060 for the weekend of DEF CON focused on, but they feel really good when they solve that 956 00:41:52,060 --> 00:41:52,600 one challenge. 957 00:41:52,940 --> 00:41:55,580 Meanwhile, five other guys solve 15 other challenges. 958 00:41:56,440 --> 00:41:57,960 Yeah, no doubt, no doubt. 959 00:41:57,960 --> 00:42:02,340 Yeah, and yeah, on that note, that's pretty much the end of what we wanted to talk to 960 00:42:02,340 --> 00:42:02,660 you about today. 961 00:42:03,440 --> 00:42:08,460 I just wanted to thank all the teams that have ever played in quals, played in CTF itself. 962 00:42:08,740 --> 00:42:12,760 You guys have definitely shown some amazing skills, and really watching the progression 963 00:42:12,760 --> 00:42:16,100 of folks that have actually started in the first year that we did this and where they're 964 00:42:16,100 --> 00:42:17,300 at now, truly amazing. 965 00:42:17,500 --> 00:42:19,160 Like the one guy we had mentioned before, Atlas. 966 00:42:19,540 --> 00:42:22,140 The first year we did this, you know, we didn't actually put this in the presentation, 967 00:42:22,340 --> 00:42:26,440 but we allowed individual competitors to play, so we had seven teams, and then we 968 00:42:26,440 --> 00:42:27,940 had one table that we just had seven. 969 00:42:27,940 --> 00:42:32,760 We set up as the Ronin, and they were allowed, they basically had no server to defend, and 970 00:42:32,760 --> 00:42:36,120 therefore their SLA was always at 100%, but there was only one guy. 971 00:42:36,280 --> 00:42:37,620 They were just sort of one-man armies. 972 00:42:37,800 --> 00:42:40,060 They eventually sort of teamed up with each other, which was quite smart. 973 00:42:41,200 --> 00:42:46,100 But there was one guy that played that year, Atlas, and that year he played, he did remarkably 974 00:42:46,100 --> 00:42:50,900 well, but his head was spun around by a number of these challenges that he saw. 975 00:42:51,060 --> 00:42:53,100 I mean, he was just like, what the hell? 976 00:42:53,160 --> 00:42:54,200 How do people figure this out? 977 00:42:55,120 --> 00:42:57,800 And he's actually the captain of the team last place. 978 00:42:57,800 --> 00:43:01,480 That actually won twice in the four years that we ran CTF in the following years, because 979 00:43:01,480 --> 00:43:02,840 the kid just like went nuts. 980 00:43:03,600 --> 00:43:08,260 Every time we had a quals, he would actually take every one of the challenges, download 981 00:43:08,260 --> 00:43:08,620 them all. 982 00:43:08,700 --> 00:43:13,800 He put up a page, nopsrus, N-O-P-S-R dot U-S. 983 00:43:13,960 --> 00:43:14,640 You can go to it. 984 00:43:14,680 --> 00:43:18,900 They have all the quals challenges for the past couple years, along with full explanations. 985 00:43:19,160 --> 00:43:21,420 He figured them all out, even offline after the thing was done. 986 00:43:21,740 --> 00:43:25,240 Wrote up explanations for how to do it, so if you're interested in actually getting better 987 00:43:25,240 --> 00:43:27,400 at this stuff, I couldn't recommend a better place to go. 988 00:43:27,400 --> 00:43:30,600 And start playing around, because you can download all the binaries and everything right 989 00:43:30,600 --> 00:43:31,080 from his site. 990 00:43:31,800 --> 00:43:33,900 And it's cool to see people get better at it. 991 00:43:33,960 --> 00:43:34,860 I mean, I think it's an important thing. 992 00:43:35,080 --> 00:43:39,740 In these days of web hacking, it's important to remember some of the binary madness that 993 00:43:39,740 --> 00:43:41,040 goes on behind the scenes. 994 00:43:42,740 --> 00:43:44,080 So that's about the end of it. 995 00:43:44,140 --> 00:43:44,660 Thanks for your time. 996 00:43:44,900 --> 00:43:48,820 I guess we're doing questions, or yeah, I guess we're doing them in the other room. 997 00:43:48,940 --> 00:43:49,320 Is that the- 998 00:43:49,320 --> 00:43:50,460 Speaker 2 in audience 1-0-5 across the hall. 999 00:43:50,580 --> 00:43:51,080 There we go. 1000 00:43:51,240 --> 00:43:52,360 1-0-5 across the hall.