1 00:00:18,480 --> 00:00:19,420 We'll see. 2 00:00:19,420 --> 00:00:20,580 Let's try this again. 3 00:00:20,580 --> 00:00:20,980 Yes. 4 00:00:20,980 --> 00:00:23,040 Oh, I think we're audible. 5 00:00:23,040 --> 00:00:24,020 Oh, nice. 6 00:00:24,020 --> 00:00:25,120 Hello everybody. 7 00:00:25,580 --> 00:00:26,720 It's been crazy. 8 00:00:26,720 --> 00:00:28,060 This has been a crazy day. 9 00:00:28,280 --> 00:00:29,020 Welcome. 10 00:00:29,060 --> 00:00:30,300 I'm CypherTX. 11 00:00:30,300 --> 00:00:31,500 I'm here with Carl. 12 00:00:31,500 --> 00:00:32,260 Hello. 13 00:00:32,680 --> 00:00:34,380 We have we've had a busy day. 14 00:00:34,380 --> 00:00:35,820 Yeah, yeah. 15 00:00:36,160 --> 00:00:37,240 But now we're here. 16 00:00:37,240 --> 00:00:40,300 We're here and we'll find out shortly whether the challenges are here. 17 00:00:40,300 --> 00:00:43,440 We've got four competitors in the back. 18 00:00:44,980 --> 00:00:46,640 The challenges are tested. 19 00:00:46,640 --> 00:00:48,880 So I think we're ready to count it in. 20 00:00:48,920 --> 00:00:55,520 Let's just do a really quick introduction of kind of what the format is this year and what teams we have and how this is going to work. 21 00:00:55,520 --> 00:00:55,740 Right. 22 00:00:55,740 --> 00:00:57,020 We will talk more about this. 23 00:00:57,020 --> 00:01:02,080 But the very short thing is we have a head-to-head, two players, one challenge. 24 00:01:02,080 --> 00:01:04,160 First one to solve it wins. 25 00:01:04,160 --> 00:01:05,520 Two matches running in parallel. 26 00:01:05,520 --> 00:01:07,820 We will be casting and commentating one of them. 27 00:01:08,020 --> 00:01:12,040 If you really want to watch the other one or the live feed from the players, it's available. 28 00:01:12,640 --> 00:01:14,100 And I think that's it for now. 29 00:01:14,100 --> 00:01:15,580 We will talk more about it later. 30 00:01:15,600 --> 00:01:24,780 We're going to get the teams started and then we can, you know, talk about the challenge and all that. 31 00:01:24,780 --> 00:01:30,460 So I'm just going to, you know, look over to production and say that we are ready to go. 32 00:01:30,680 --> 00:01:31,120 I'm ready. 33 00:01:31,160 --> 00:01:32,240 Countdown. 34 00:01:32,420 --> 00:01:36,980 Five, four, three, two, one. 35 00:01:36,980 --> 00:01:37,540 Go. 36 00:01:37,540 --> 00:01:38,620 Let them go. 37 00:01:39,780 --> 00:01:40,680 All right. 38 00:01:40,680 --> 00:01:41,980 So we should be going. 39 00:01:41,980 --> 00:01:42,400 Yep. 40 00:01:42,400 --> 00:01:48,200 And let's switch over to one of our competitors here. 41 00:01:48,200 --> 00:01:49,600 Full screen terminal already. 42 00:01:49,600 --> 00:01:50,660 Yep. 43 00:01:50,660 --> 00:01:58,920 So the way this is going to work, both of the players, they are given a challenge, the same challenge. 44 00:01:58,980 --> 00:02:08,240 It is a pwnable challenge of binary exploitation, you know, memory corruption, vulnerabilities and exploits that we're looking at here. 45 00:02:08,240 --> 00:02:21,880 The goal of this is to take this program, this binary, find a vulnerability, develop an exploit, test it locally and then exploit this on a remote server. 46 00:02:21,880 --> 00:02:27,120 Once you do that, you will eventually manage to get code execution on this server. 47 00:02:27,540 --> 00:02:29,700 And that's when then you're basically done. 48 00:02:29,700 --> 00:02:35,540 And then to prove that you're done, you will run the command on the server, which, yeah. 49 00:02:35,540 --> 00:02:38,960 But this year, unlike last year, we're a double elimination tournament. 50 00:02:38,960 --> 00:02:43,280 So last time it was as soon as you lost, you were out. 51 00:02:43,280 --> 00:02:45,440 But this time you have to lose twice before you're out. 52 00:02:45,440 --> 00:02:51,000 So that gives teams one a little bit more of a buffer, which is great, but also increases the complexity a fair amount. 53 00:02:51,000 --> 00:02:51,160 Yeah. 54 00:02:51,160 --> 00:02:53,720 We've got a bunch more streams, a bunch more captures. 55 00:02:54,100 --> 00:02:58,240 We've got a whole lot that we're trying to juggle here. 56 00:02:58,260 --> 00:03:06,800 So we've got the two teams that we're going to be looking at here are going to be Pigbuttsad and then they're playing against mHackeroni. 57 00:03:06,800 --> 00:03:10,260 So those are our two teams that we're eyeballing. 58 00:03:10,260 --> 00:03:12,140 We don't have the overlay text. 59 00:03:12,140 --> 00:03:16,180 We're a little bit... we'll get that added as we move forward. 60 00:03:16,180 --> 00:03:16,580 Yes. 61 00:03:16,580 --> 00:03:19,040 But we're currently looking at mHackeroni. 62 00:03:19,040 --> 00:03:19,540 Right. 63 00:03:19,540 --> 00:03:29,260 So they are here in IDA, one of the popular reverse engineering platforms, the disassembly compiler. 64 00:03:29,260 --> 00:03:43,200 You can see the player here looking at the code, you know, renaming variables because, you know, they only get these... they get this decompilation, which is very nice, but you still have, you know, no variable names and so on. 65 00:03:43,200 --> 00:03:49,900 So they're trying to like clean up the code here to be able to understand what's going on. 66 00:03:49,900 --> 00:03:54,100 So it's kind of as you can see, because we've got the... we're currently in the overlay view. 67 00:03:54,100 --> 00:03:58,080 It was very convenient these two teams to choose dark and light themes for us. 68 00:03:58,080 --> 00:04:03,580 So it's really obvious when we're in... when we're looking at mHackeroni, they're going to be the dark IDA. 69 00:04:03,580 --> 00:04:07,720 And when we're looking at PigButSAD, they're going to be over there in the light IDA. 70 00:04:07,720 --> 00:04:12,280 And we can flip back and forth and take a look at kind of each one in a little more detail. 71 00:04:12,280 --> 00:04:15,100 So let's switch over to PigButSAD. 72 00:04:15,600 --> 00:04:18,520 You can see they're looking at essentially the same piece of code. 73 00:04:18,520 --> 00:04:21,960 This is kind of the core functionality of this program. 74 00:04:21,960 --> 00:04:28,480 You can see that they are trying to create some structures here to figure out what is going on. 75 00:04:28,480 --> 00:04:28,860 So this... 76 00:04:28,860 --> 00:04:30,040 And I saw that it had a name. 77 00:04:30,040 --> 00:04:32,340 So that function name was called interpreter, right? 78 00:04:32,340 --> 00:04:36,180 So do we have symbols in these binaries, or did they already name that? 79 00:04:36,440 --> 00:04:37,120 Let's see. 80 00:04:37,120 --> 00:04:40,480 I think... I think this one does have symbols. 81 00:04:41,120 --> 00:04:44,180 Yeah, this varies from... no, I'm looking over here. 82 00:04:44,180 --> 00:04:47,140 No, we... yes, yes, we do have... we do have symbols in this one. 83 00:04:47,140 --> 00:04:59,900 So we have function names to help them out a little bit, because, you know, we want... so these challenges... so we want to make these challenges, you know, easy enough that we can do this kind of like high-speed format here. 84 00:05:00,240 --> 00:05:09,440 So that's... sometimes we do give them some, you know, things to grab onto, like the function names and so on. 85 00:05:09,440 --> 00:05:09,560 Yeah. 86 00:05:09,980 --> 00:05:15,020 Sometimes we decide to strip them out if that makes more sense in the context of the challenge. 87 00:05:15,020 --> 00:05:16,100 Yeah, but these are... 88 00:05:16,100 --> 00:05:20,820 so these matches that we've got, normally we're scheduled for about an hour each match. 89 00:05:20,920 --> 00:05:24,280 And if things go to plan, we want them to be solved in like 40 minutes, right? 90 00:05:24,280 --> 00:05:27,460 The goal is actually 40 minutes after the challenge starts. 91 00:05:27,800 --> 00:05:31,480 They should be at that point already done, because we do go to a sudden death. 92 00:05:31,480 --> 00:05:35,520 So if it's taking them more than 50, we're going to go to a sudden death mode. 93 00:05:35,520 --> 00:05:41,700 And at that point, we give them a new challenge that is like as simple as it can be. 94 00:05:41,700 --> 00:05:43,880 It's meant to be very, very basic. 95 00:05:43,880 --> 00:05:47,000 And that's a truly painful race at that point. 96 00:05:47,000 --> 00:05:47,540 Yep. 97 00:05:47,660 --> 00:06:02,580 And we can see here on the Piglet side reversing that they are still working on... you can see there they named one of the fields of the structure PC, typically for a program counter. 98 00:06:03,000 --> 00:06:05,440 And we did tell them the category in advance, right? 99 00:06:05,440 --> 00:06:12,300 So we try to tell teams the architecture, whether it's a reversing challenge, a pwnable challenge, a little bit of information about it. 100 00:06:12,660 --> 00:06:14,380 Primarily because we want them to send their best person. 101 00:06:14,380 --> 00:06:16,360 Different teammates will have different skills. 102 00:06:16,780 --> 00:06:26,080 And so in fact, for example, one of the the organizers came up and said, well, you've listed us for a challenge that says Linux Pwn, but is it Linux Kernel or Linux Userland? 103 00:06:26,080 --> 00:06:26,400 Right. 104 00:06:26,460 --> 00:06:28,780 Because they're like, it's a different guy we send for each one of those. 105 00:06:28,900 --> 00:06:32,280 And so we do try to, you know, try to give them a little information. 106 00:06:32,280 --> 00:06:35,180 And for this particular challenge, which by the way, anyone can see. 107 00:06:35,180 --> 00:06:45,500 If you go to the challenge.com, we have the full bracket there. 108 00:06:45,500 --> 00:06:46,040 You can see it. 109 00:06:46,040 --> 00:06:52,580 But if you actually go to the raw challenge page as well, there's details for every one of those matches. 110 00:06:52,580 --> 00:06:55,540 And so it not only links to the streams where you can see it. 111 00:06:55,540 --> 00:06:57,480 So again, these are just the two of the players we've got. 112 00:06:57,480 --> 00:07:02,040 And we've also got Hypeboy and TWN playing at the same time on the same challenge. 113 00:07:02,040 --> 00:07:06,680 And it's entirely possible that the fastest solve actually comes on one of those feeds. 114 00:07:06,780 --> 00:07:07,240 So , right. 115 00:07:07,240 --> 00:07:14,700 And I want to switch over here to Hackeroni because they are writing a part of their exploit script here, which I think is really cool. 116 00:07:14,700 --> 00:07:18,620 So they are writing this in Python using Pwn tools. 117 00:07:18,620 --> 00:07:24,280 And you can see that at the top of their script there, you can see that they had written out a couple of functions. 118 00:07:24,280 --> 00:07:33,560 So they have small like, you could always call them like macros, helper functions with short names that you can quickly just, you know, plug in there. 119 00:07:34,060 --> 00:07:50,000 They are, you can see that they're building up a kind of payload here where they're using the cyclic function in Pwn tools, which is a very handy tool where, let's say you have some kind of overflow and you gain control of some value that you're in, like, 120 00:07:50,000 --> 00:07:52,400 for example, the return address or some register or so on. 121 00:07:52,400 --> 00:07:57,760 But you're unsure exactly which part of your payload ends up in that location. 122 00:07:57,760 --> 00:08:11,260 You can use this cyclic function to generate a pattern, send it, look in the debugger, and then immediately deduce... Those four bytes or eight bytes are exactly a unique offset into that buffer. 123 00:08:11,260 --> 00:08:11,520 Right. 124 00:08:11,520 --> 00:08:14,560 So there's like DeBruin sequence generators, the other, you know, name for you. 125 00:08:14,560 --> 00:08:15,080 Somebody else will hear that. 126 00:08:15,080 --> 00:08:15,860 Exactly. 127 00:08:15,940 --> 00:08:30,600 So the, instead of trying to like calculate this by looking at the various offsets and like figuring out how much of the stack will be popped and so on, you just like dump this in, look in the debugger, and then you like calculate backwards to get the index. 128 00:08:30,600 --> 00:08:37,400 This was not a common technique when I started, so I remember putting just a bunch of A's and then B's and trying to like binary search it, just trying to figure out where it was. 129 00:08:37,400 --> 00:08:40,500 And this is like the sophisticated version of that. 130 00:08:40,500 --> 00:08:44,040 It's also much, much faster too, which is good for a live CTF. 131 00:08:44,040 --> 00:08:44,520 Yeah. 132 00:08:45,800 --> 00:09:04,060 So this leads me to believe that they have kind of found the vulnerability, but you know, they're now kind of exploring it to see exactly how and what they control, which is like good progress there. 133 00:09:04,180 --> 00:09:15,340 We have seen people too, though, in the past, sometimes they start their PwnScript immediately, even as they're just exploring the service and interacting with it, or they want to use it to generate things in a debugger just to kind of see what the behavior is. 134 00:09:15,340 --> 00:09:18,300 But yeah, usually you would think that they've got the exploit there. 135 00:09:18,300 --> 00:09:19,600 They may or may not. 136 00:09:20,160 --> 00:09:25,620 We are seeing in PigButtSAD, they've now also switched over a little bit to debugger, which went back to... 137 00:09:25,620 --> 00:09:25,960 Right. 138 00:09:25,960 --> 00:09:27,280 Let's go over to their screen. 139 00:09:27,280 --> 00:09:27,940 There we go. 140 00:09:27,940 --> 00:09:28,340 Yeah. 141 00:09:28,680 --> 00:09:29,220 Yeah. 142 00:09:29,220 --> 00:09:33,140 Some exploit here also using Python with PwnTools, also some helper functions. 143 00:09:33,140 --> 00:09:34,320 The same helper, like the same... Yeah. 144 00:09:34,320 --> 00:09:39,640 Maybe, I wonder if there's like, you know, now they're slightly different, but it's, you know, similar contents. 145 00:09:39,640 --> 00:09:39,840 Very , very similar. 146 00:09:39,840 --> 00:09:40,400 Yeah. 147 00:09:41,680 --> 00:09:44,200 So also running some debugger. 148 00:09:45,560 --> 00:09:46,280 Yeah. 149 00:09:46,340 --> 00:09:49,160 I did not see quite what they were sending in. 150 00:09:50,080 --> 00:09:52,560 I think maybe they're just also exploring... 151 00:09:52,560 --> 00:09:55,020 Oh , there was a breakpoint on OXDeadBeef. 152 00:09:55,360 --> 00:09:56,260 So I don't know if it's... Okay. 153 00:09:56,260 --> 00:09:56,900 They're just coming out right now. 154 00:09:56,900 --> 00:09:58,420 That was like leftover maybe. 155 00:09:58,420 --> 00:09:58,540 Yeah. 156 00:09:58,540 --> 00:09:59,840 Maybe just setting up their environment. 157 00:09:59,840 --> 00:10:02,480 I was like, they already have control of EIP. 158 00:10:02,480 --> 00:10:02,940 No, no, no. 159 00:10:02,940 --> 00:10:09,500 I think it's, you know, they're just setting up the GDB scripting and then making sure that, you know, they have their stuff in order. 160 00:10:10,360 --> 00:10:26,720 So, I mean, this is a very nice... PwnTools has a lot of nice features like this, where you can start your program, attach a debugger, run the GDB script, for example, set up some breakpoints, like all of these things to help you do this iterative process of developing the exploit. 161 00:10:26,720 --> 00:10:33,500 So minimize the number of manual commands you have to type in each time you test your exploits. 162 00:10:33,500 --> 00:10:34,520 So I don't think... Did the teams... 163 00:10:36,420 --> 00:10:39,800 We gave them the binary name, correct, when they downloaded this? 164 00:10:40,020 --> 00:10:42,000 Or did we just call it something generic? 165 00:10:42,200 --> 00:10:51,440 No, they do get... So the archive that they download is called PushPop Automaton, which is the name of this challenge. 166 00:10:51,820 --> 00:11:02,100 And, yeah, it's a stack-based virtual machine, which has a... I bet it has a push and a pop. 167 00:11:02,100 --> 00:11:03,320 Yeah, yeah, yeah. 168 00:11:03,320 --> 00:11:06,280 Very few operations, including a push and a pop. 169 00:11:06,280 --> 00:11:23,200 So you can, like, grow and shrink this stack structure, which, you know, if one would just take a guess at what the vulnerability could be, you know, maybe this pushing and popping, it does not properly respect the bounds of this. 170 00:11:23,200 --> 00:11:23,200 What ? 171 00:11:23,200 --> 00:11:25,660 A CTF challenge that doesn't have bounds checking? 172 00:11:25,660 --> 00:11:26,740 That's shocking. 173 00:11:26,740 --> 00:11:27,860 Shocking, yeah. 174 00:11:27,980 --> 00:11:29,000 So we can see here some... 175 00:11:31,180 --> 00:11:34,600 On the Macaroni's side, they're looking in the debugger. 176 00:11:34,600 --> 00:11:46,180 We see that they're dumping some memory, trying to figure out exactly what, you know, what things are in the memory at a certain point in time. 177 00:11:46,180 --> 00:11:48,840 I'm not sure what this point in time is. 178 00:11:49,780 --> 00:11:57,760 But, yeah, it's hard to tell exactly how far their progress is right now. 179 00:11:57,760 --> 00:12:00,380 Like, the exploit script was still pretty bare bones. 180 00:12:00,760 --> 00:12:02,660 Now, is this one that you playtested? 181 00:12:02,680 --> 00:12:05,580 I know that this was a challenge Glenn wrote. 182 00:12:05,580 --> 00:12:06,020 Yep. 183 00:12:06,020 --> 00:12:09,360 But this is one you've solved before, so you've at least got a solution. 184 00:12:09,360 --> 00:12:14,320 Although, as is the case for us in a lot of our challenges, we don't know if we'll see the same solution. 185 00:12:14,320 --> 00:12:14,620 Right. 186 00:12:14,620 --> 00:12:18,080 There may very well be multiple ways to solve it. 187 00:12:18,080 --> 00:12:18,520 Yep. 188 00:12:19,060 --> 00:12:20,440 I did solve it. 189 00:12:20,440 --> 00:12:25,660 It was probably one of the first ones I did in our whole development process. 190 00:12:25,660 --> 00:12:27,460 So it was a couple of weeks ago. 191 00:12:30,280 --> 00:12:36,380 But it is, I mean, so it is pretty straightforward. 192 00:12:36,720 --> 00:12:49,920 But you also have the added, you know, stress of this format, the live CTF format with, you know, it's this one-on-one, you have no help from your teammates. 193 00:12:50,040 --> 00:12:58,960 Oh, and yeah, the time pressure alone, just knowing that there's one person you're racing and that the first to solve it is like, you know, the victor with all the points. 194 00:12:59,260 --> 00:13:00,600 It's stressful. 195 00:13:00,600 --> 00:13:01,360 It really is. 196 00:13:01,360 --> 00:13:01,780 Yeah. 197 00:13:01,820 --> 00:13:05,120 And we are, I mean, we are running a double elimination this year, right? 198 00:13:05,120 --> 00:13:12,400 So, you know, you're not out immediately, but it's still like, you know, this is one of your two chances, right? 199 00:13:12,620 --> 00:13:18,440 And so let's talk about the points and the scoring and how this kind of factors into the overall DEF CON CTF, right? 200 00:13:18,440 --> 00:13:21,940 So that we are in the middle of DEF CON here in Las Vegas. 201 00:13:22,400 --> 00:13:25,420 And there's 12 teams here at the final event. 202 00:13:25,640 --> 00:13:30,040 Each of the 12 teams sends an individual for a round of live CTF. 203 00:13:30,040 --> 00:13:33,080 And those individuals don't have to be the same. 204 00:13:33,080 --> 00:13:37,980 So if they play multiple rounds, they could actually choose to send a different person. 205 00:13:37,980 --> 00:13:40,360 That's again, also why we tell them the category. 206 00:13:40,360 --> 00:13:40,660 Yeah. 207 00:13:40,660 --> 00:13:41,760 So they know who they can send. 208 00:13:41,760 --> 00:13:44,860 I want to just bring attention here to PigBetSav. 209 00:13:44,860 --> 00:13:50,860 You can see that there were a bunch of memory leaking out there on their screen that we have up. 210 00:13:50,860 --> 00:13:52,760 You can see here the memory dump in PwnTool. 211 00:13:52,760 --> 00:13:56,780 So they're doing some kind of leak here. 212 00:13:57,700 --> 00:14:00,460 This is a good step. 213 00:14:00,760 --> 00:14:02,820 Yeah, that would be step one of this exploit. 214 00:14:02,820 --> 00:14:04,540 Almost certainly would be some kind of leak. 215 00:14:04,540 --> 00:14:07,400 Any modern binary, you've got to have a leak kind of built into it. 216 00:14:07,400 --> 00:14:17,080 So if I remember correctly, basically you use the pop feature to read memory. 217 00:14:17,460 --> 00:14:19,400 You go further than you were supposed to. 218 00:14:19,400 --> 00:14:22,640 And then you use the push feature to modify those things. 219 00:14:24,320 --> 00:14:28,600 And so that gives you both a read and a write primitive on the stack. 220 00:14:28,600 --> 00:14:28,820 Yeah. 221 00:14:28,820 --> 00:14:40,840 And then there are a couple of things you need to keep in mind, because since you're going like backwards and forwards, you need to keep track of the order, because you're writing things in the opposite order of what you were reading. 222 00:14:41,800 --> 00:14:45,440 So there are details to keep in mind there. 223 00:14:45,440 --> 00:14:48,140 And that's the hardest when there's the time pressure. 224 00:14:48,140 --> 00:14:51,480 It's the kind of thing where if you were casually doing it, you wouldn't even be fine. 225 00:14:51,480 --> 00:14:53,860 But when you're in a hurry, it's easy to miss that. 226 00:14:53,860 --> 00:15:01,740 And then off by one things, like the push thing, does it write first and then increment the pointer? 227 00:15:01,760 --> 00:15:08,020 Is the pointer pointing to the current empty slots or the top of the stack? 228 00:15:08,020 --> 00:15:11,280 And you can easily get an off by one issue there. 229 00:15:11,280 --> 00:15:16,160 I think both teams did exactly the right thing, though, because debugging will help you answer a lot of those questions, right? 230 00:15:16,160 --> 00:15:17,520 You want to have your script. 231 00:15:17,980 --> 00:15:23,220 There are people that I know who can one-shot this, and they just muddle it in their head, and then they solve it, and they write it, and they're done. 232 00:15:23,220 --> 00:15:24,160 And they're fun to watch. 233 00:15:24,160 --> 00:15:27,200 But certainly, I would be using a debugger as well. 234 00:15:27,200 --> 00:15:27,440 Yeah. 235 00:15:27,440 --> 00:15:29,960 I want to go over to Macaroni again and bring attention here. 236 00:15:29,960 --> 00:15:45,840 You can see that they're writing this leak equals, and then they are... So they've already got a leak, and now we're going to... So they're just... And then using the debug printing here to validate, yeah, you can see that they printed out an address. 237 00:15:45,900 --> 00:15:47,220 What does it look like? 238 00:15:47,220 --> 00:15:48,580 Code address, though. 239 00:15:48,580 --> 00:15:50,180 I'm not sure what they're trying to leak. 240 00:15:50,580 --> 00:15:52,740 It seems like it's off. 241 00:15:53,280 --> 00:15:58,560 Like the 55 is usually like a good... Oh, that one, though, looks like... There we go. 242 00:15:58,560 --> 00:15:59,760 You can see this 7F thing. 243 00:15:59,760 --> 00:16:00,040 Yeah. 244 00:16:00,040 --> 00:16:04,380 Looks very much like a library address, right? 245 00:16:04,380 --> 00:16:04,860 Yeah, library. 246 00:16:04,860 --> 00:16:05,400 Yeah. 247 00:16:05,400 --> 00:16:08,240 Well, I bet they're going to see what they do. 248 00:16:08,940 --> 00:16:11,480 And they're checking... Yeah. 249 00:16:11,480 --> 00:16:15,340 So they're copying the leak over, or they were copying the leak over. 250 00:16:15,380 --> 00:16:16,300 Let's see. 251 00:16:16,300 --> 00:16:17,380 They have a leak. 252 00:16:17,380 --> 00:16:18,400 Copy it. 253 00:16:18,400 --> 00:16:26,200 Are they going to check in like via map or... So they're checking this is in... Yeah. 254 00:16:26,200 --> 00:16:27,320 So they got the... Okay. 255 00:16:27,320 --> 00:16:27,600 Yeah. 256 00:16:27,600 --> 00:16:35,440 So there was an in the offset, and you can see they use this feature in GDB to take this address. 257 00:16:35,440 --> 00:16:41,580 This is an absolute address, but the GDB plugins convert this into an offset within the library. 258 00:16:41,580 --> 00:16:54,300 So now they can then bring this back into their exploit script, and you can see that they subtract this offset from the leak to get the base address of libc, bring this back into the script, and now they can easily calculate any addresses within libc that they are... 259 00:16:54,300 --> 00:16:57,960 They'll look for one gadget or whatever other function pointers they want to call. 260 00:16:57,960 --> 00:17:07,560 Although this is complete overkill for this challenge because you have a win function, but... Oh, I don't know if we saw anyone look at the win function there. 261 00:17:07,560 --> 00:17:11,560 So I saw that the function list was open, and there's... You can see... Oh, yeah. 262 00:17:11,560 --> 00:17:13,180 You saw it there very briefly. 263 00:17:13,180 --> 00:17:13,260 Yeah. 264 00:17:13,260 --> 00:17:13,500 Yeah. 265 00:17:13,500 --> 00:17:13,580 Yeah. 266 00:17:13,580 --> 00:17:15,280 And especially because we gave them the symbols, right? 267 00:17:15,280 --> 00:17:16,900 Because they've got the symbols for function names. 268 00:17:16,900 --> 00:17:27,700 But this is so easy to miss because like, okay, this is maybe not a super common thing to have in modern challenges. 269 00:17:27,700 --> 00:17:32,480 We've kind of evolved past that in the CTF community, in the CTF challenges. 270 00:17:32,480 --> 00:17:41,640 But again, since we want this to be very fast, very... Well, compared to a lot of pwnable challenges, easy to solve. 271 00:17:41,720 --> 00:17:43,080 I'm not saying it's easy. 272 00:17:43,080 --> 00:17:44,200 It's easier. 273 00:17:44,860 --> 00:17:46,440 And that's why we put this in. 274 00:17:46,440 --> 00:17:46,960 Don't feel bad. 275 00:17:46,960 --> 00:17:50,340 It's certainly... I wouldn't be able to solve this in an hour or as fast as these teams were. 276 00:17:50,340 --> 00:17:56,980 So don't feel bad if you're doing this and thinking, wow, you call this easy, but it took me, you know, like several hours. 277 00:17:56,980 --> 00:18:01,720 Like this is just relatively speaking to sort of the state of the art in pwnable challenges now. 278 00:18:01,760 --> 00:18:03,540 So yeah, it is a little more unusual. 279 00:18:03,540 --> 00:18:12,020 And you know, I would have expected to see... Although actually they would need a leak to the program itself, right? 280 00:18:12,020 --> 00:18:12,280 Right. 281 00:18:12,280 --> 00:18:12,400 Right. 282 00:18:12,400 --> 00:18:12,580 Right. 283 00:18:12,580 --> 00:18:12,700 Right. 284 00:18:12,700 --> 00:18:13,860 So, I mean, this is a different approach. 285 00:18:13,860 --> 00:18:17,720 Maybe it's, you know... It may have been the first pointer they grabbed was a libc and good enough. 286 00:18:17,720 --> 00:18:18,900 They can get system out of that. 287 00:18:18,900 --> 00:18:19,060 Right. 288 00:18:19,060 --> 00:18:22,360 So I want to bring back attention here now to PigBetSAD. 289 00:18:22,360 --> 00:18:26,020 You can see a little bit more of their exploit script there. 290 00:18:26,020 --> 00:18:28,100 You have some... 291 00:18:30,340 --> 00:18:31,480 They are... Okay. 292 00:18:31,480 --> 00:18:36,660 They're reading until they can see these specific bytes. 293 00:18:36,700 --> 00:18:39,520 So they're also looking at some leak here. 294 00:18:39,520 --> 00:18:41,120 You can see some memory dump. 295 00:18:41,500 --> 00:18:44,920 I'm trying to like orient myself here at what they're doing. 296 00:18:44,920 --> 00:18:49,100 It is interesting that they're building their GDB into their same script as well. 297 00:18:49,100 --> 00:18:53,400 As opposed to we saw earlier in Hackeroni had a separate session that they were debugging it with. 298 00:18:55,320 --> 00:18:56,120 Yeah. 299 00:18:56,300 --> 00:18:56,800 So, yeah. 300 00:18:56,800 --> 00:18:58,280 Are they getting back a pointer? 301 00:18:58,280 --> 00:19:03,660 Are they... Here we can see... I mean, there's a bunch of memory being dumped out. 302 00:19:03,660 --> 00:19:03,760 Yeah. 303 00:19:03,760 --> 00:19:05,260 They looked like environment variables. 304 00:19:05,260 --> 00:19:05,460 Yeah. 305 00:19:05,460 --> 00:19:06,320 Environment from stack. 306 00:19:06,320 --> 00:19:06,600 Yeah. 307 00:19:06,600 --> 00:19:07,220 Yep. 308 00:19:07,360 --> 00:19:08,080 Absolutely. 309 00:19:08,080 --> 00:19:08,140 Right. 310 00:19:08,140 --> 00:19:08,300 Right. 311 00:19:08,300 --> 00:19:10,540 Right on the stack prior to your... Right. 312 00:19:10,540 --> 00:19:11,440 Your main. 313 00:19:13,120 --> 00:19:24,640 I... Actually, let's leave them there for a moment and go back to Macaroni because I think there's some pretty good stuff coming up here. 314 00:19:24,640 --> 00:19:28,920 I saw that... You can see that they're trying to put together a ROP chain. 315 00:19:30,720 --> 00:19:31,160 Let me see. 316 00:19:31,160 --> 00:19:39,220 This is... You know, it's a little bit difficult to follow now because they're jumping very quickly back and forth between the export script and the debugger. 317 00:19:39,220 --> 00:19:43,540 You know, they're making small changes, trying it and doing like very quick iterations. 318 00:19:43,540 --> 00:19:47,240 You can see them like fiddling with like some offsets here and there. 319 00:19:47,240 --> 00:19:48,440 This is exactly what I'm talking about. 320 00:19:48,440 --> 00:19:51,500 These things are... Very fiddly. 321 00:19:51,500 --> 00:19:51,820 Yeah. 322 00:19:51,820 --> 00:19:52,260 Yeah. 323 00:19:52,860 --> 00:20:01,060 And can be so frustrating because like you feel like you should have this, like I know what's going on and that something is like not adding up. 324 00:20:01,060 --> 00:20:03,360 Like you forget some detail. 325 00:20:04,040 --> 00:20:05,840 Extremely frustrating. 326 00:20:05,840 --> 00:20:06,020 Yeah. 327 00:20:06,020 --> 00:20:12,380 It looks like they're actually changing... They had a libc leak clearly earlier, but now they've gone back and they're changing it again. 328 00:20:12,380 --> 00:20:15,920 Did they... Did they... The environment... Did something change or what? 329 00:20:15,920 --> 00:20:21,120 I'm wondering what they're doing that's causing them to undo the progress they felt like they've made earlier. 330 00:20:21,440 --> 00:20:23,020 And I'll keep an eye out. 331 00:20:23,020 --> 00:20:28,200 I don't see Pigbuttsad having successfully gotten... Oh, they do think they have a leak now. 332 00:20:28,200 --> 00:20:28,640 Let's see. 333 00:20:29,000 --> 00:20:29,360 They're... 334 00:20:29,360 --> 00:20:29,560 Yeah. 335 00:20:29,560 --> 00:20:31,940 Well, let's switch over to them and look at that. 336 00:20:31,940 --> 00:20:33,500 I think they might have... Yeah. 337 00:20:33,500 --> 00:20:38,020 So it looks like they're dumping... Oh, so we've now dumped some... Right. 338 00:20:38,020 --> 00:20:39,520 And there they're also calculating. 339 00:20:39,560 --> 00:20:52,760 You can see they didn't use as fancy features there, but you can see that they're calculating an offset by subtracting those two absolute addresses there in the exploit script, those 7F addresses. 340 00:20:52,760 --> 00:20:53,040 Yeah. 341 00:20:53,040 --> 00:21:03,960 This will give them... So you see they take the values in the specific instance, take the difference, get the offset, and then use that to calculate the base there. 342 00:21:03,960 --> 00:21:07,600 Slightly longer version of the same thing that we saw in Macaroni... Yeah. 343 00:21:08,100 --> 00:21:10,180 That we just copy and paste. 344 00:21:10,180 --> 00:21:10,680 Yeah. 345 00:21:12,460 --> 00:21:14,080 It's... Right. 346 00:21:14,360 --> 00:21:19,540 So, yeah, they're back in the disassembler. 347 00:21:20,180 --> 00:21:27,240 You know, I think this is interesting because we had quite a, you know, a period here of them, like, mostly looking at the exploit script and the debugger. 348 00:21:27,240 --> 00:21:27,940 Yeah. 349 00:21:28,100 --> 00:21:37,900 And now they're coming back into the disassembler, maybe double checking some... Maybe they were just looking at the size of this buffer or the stack thing. 350 00:21:38,880 --> 00:21:39,620 Yeah. 351 00:21:39,620 --> 00:21:48,360 It looks like their structure offset they were using to determine... Oh, we had, by the way, a solve on our other stream. 352 00:21:48,360 --> 00:21:49,580 Oh, my God. 353 00:21:49,580 --> 00:21:51,080 Check out our other stream. 354 00:21:51,220 --> 00:21:52,660 Congratulations to Hypeboi. 355 00:21:52,660 --> 00:21:53,140 Yeah. 356 00:21:53,140 --> 00:21:55,540 So, really great job. 357 00:21:55,840 --> 00:22:00,460 Hyperboi win... They win their first live CTF match here. 358 00:22:00,460 --> 00:22:03,240 So, as I said, we are running two matches in parallel. 359 00:22:03,240 --> 00:22:07,360 We are casting one of them, but then there's another match going on in the background. 360 00:22:07,360 --> 00:22:11,720 And that match just finished with Hyperboi... Hypeboi. 361 00:22:11,720 --> 00:22:11,900 Hypeboi. 362 00:22:11,940 --> 00:22:15,780 Hypeboi winning against... Which team was the other one? 363 00:22:15,780 --> 00:22:19,120 Hypeboi was playing in this match... TWN48. 364 00:22:19,120 --> 00:22:19,760 Right. 365 00:22:19,760 --> 00:22:23,820 So, TWN48 against Hypeboi and Hypeboi did win that match. 366 00:22:23,820 --> 00:22:27,360 I can't wait to go watch the VOD on that one because that was a blazing fast. 367 00:22:27,360 --> 00:22:34,900 I'm just knowing, like, the progress that they must have, like, quickly know what to do and then landed that. 368 00:22:34,900 --> 00:22:35,440 Really cool. 369 00:22:35,440 --> 00:22:35,940 Good for them. 370 00:22:35,940 --> 00:22:37,120 Really cool to see. 371 00:22:37,640 --> 00:22:41,560 But we are still going strong here in this match. 372 00:22:41,860 --> 00:22:49,340 A little bit of a sigh of relief as an organizer for your full solve coming through because, I mean, you know it's solvable, you're pretty sure, but just to see somebody do it... Yeah. 373 00:22:49,340 --> 00:22:50,320 That's a good feeling. 374 00:22:50,320 --> 00:22:52,260 And, oh, my God, the issues we've had today. 375 00:22:52,680 --> 00:22:53,940 Today was cursed. 376 00:22:53,940 --> 00:22:59,020 Everything that conceivably could break, broke and a few more things. 377 00:22:59,400 --> 00:23:03,020 Yeah, so we had multiple hardware failures on laptops. 378 00:23:03,020 --> 00:23:05,400 So the machine that we're streaming to you on now died. 379 00:23:05,400 --> 00:23:07,700 The machine that's running the game infrastructure died. 380 00:23:07,700 --> 00:23:07,900 Yeah. 381 00:23:07,900 --> 00:23:10,020 We're on, like, secondary machines for all of that. 382 00:23:10,540 --> 00:23:13,760 We had our mixer board, as we came on the stream just at the very beginning. 383 00:23:13,760 --> 00:23:14,140 Right. 384 00:23:14,140 --> 00:23:16,680 Isn't connecting for some reason on the new machine we swapped out. 385 00:23:16,680 --> 00:23:17,940 So we switched audio inputs. 386 00:23:17,940 --> 00:23:19,000 It's been... Yeah. 387 00:23:19,000 --> 00:23:21,120 It's been a lot of craziness, but... Right. 388 00:23:21,320 --> 00:23:26,300 So, high five for our first... Yeah, really, really nice to see. 389 00:23:26,560 --> 00:23:32,260 And, yeah, I mean, we will also be talking a bit more throughout these days. 390 00:23:32,260 --> 00:23:35,540 We will be talking a little bit about, you know, the production, the behind the scenes and stuff. 391 00:23:35,540 --> 00:23:38,120 But, you know, we will come back to that. 392 00:23:38,120 --> 00:23:41,860 We can talk a little bit more about... So now we want to get back on schedule and get things going. 393 00:23:41,860 --> 00:23:42,420 Right. 394 00:23:42,420 --> 00:23:46,220 So let's check out Macaroni again. 395 00:23:46,920 --> 00:23:50,940 You can see here, it feels like they're trying to... 396 00:23:50,940 --> 00:23:53,840 Looks like some indices and values. 397 00:23:53,840 --> 00:23:57,060 They're trying to figure out some kind of offset, maybe. 398 00:23:57,420 --> 00:24:03,540 You could see there was a big list of various offsets, and I guess it was the corresponding value or something. 399 00:24:03,540 --> 00:24:12,540 And I think they're trying to, again, fiddle around a little bit with the exact offsets of these exploits. 400 00:24:12,700 --> 00:24:12,960 Yeah. 401 00:24:13,060 --> 00:24:19,640 I don't feel either team is necessarily stuck, but I also don't feel like they're confidently going to the next step yet, either. 402 00:24:19,640 --> 00:24:24,140 They're still, I think, tweaking and trying to figure out. 403 00:24:24,140 --> 00:24:41,100 But it's like, you know, you can see here, like you have the ROP chain with the system call with the shell, like they have pieces there and now they're just trying to debug their exploit script and trying to find, like, where is this not doing what they think it should do? 404 00:24:41,100 --> 00:24:51,160 It actually reminds me of the first match we had last year in the finals, which you can go watch on YouTube or on livectf.com, because it was the same thing that you're tweaking and fiddling with. 405 00:24:51,160 --> 00:24:55,520 And then the team we weren't watching snuck in and actually solved it just off screen. 406 00:24:55,520 --> 00:25:02,720 Because it's hard to know, like if for one of them to suddenly figure it out exactly, it could go down in just a few seconds. 407 00:25:03,360 --> 00:25:07,660 But I do still see a lot over here on Pigbuttsad. 408 00:25:07,660 --> 00:25:09,080 Oops, wrong one. 409 00:25:09,700 --> 00:25:14,060 If we bring up Pigbuttsad, that one there. 410 00:25:14,320 --> 00:25:15,200 We can go ahead. 411 00:25:15,360 --> 00:25:18,300 They really haven't, they just, yeah, they hop back down to Vita, but they've been here for a lot. 412 00:25:18,300 --> 00:25:20,000 They're really still looking at their offsets. 413 00:25:20,000 --> 00:25:24,120 I think this, to me, still feels like in their head, they're still working out what they want to do. 414 00:25:24,120 --> 00:25:26,640 They don't have exactly the sizes figured out. 415 00:25:26,640 --> 00:25:29,780 They don't have a goal necessarily figured out. 416 00:25:30,460 --> 00:25:37,580 Because I don't, I think if you understand what the virtual machine is doing at this point, there shouldn't be a whole lot you would need to look at. 417 00:25:37,580 --> 00:25:44,820 Even things like offsets, for example, dynamically just pulling that out of your running session seems like it might have been a little easier. 418 00:25:45,720 --> 00:25:51,920 And they are, yeah, they're looking at the interpreter code. 419 00:25:52,460 --> 00:25:57,340 I mean, this is a time where you really wish you could, like, read the minds of the players. 420 00:25:57,800 --> 00:25:58,900 Yeah, yeah. 421 00:26:01,460 --> 00:26:09,780 Because, you know, they are clearly staring at this code and, you know, there's something they're trying to, like, wrap their head around. 422 00:26:10,760 --> 00:26:13,620 You're just not exactly sure what it is, right? 423 00:26:15,540 --> 00:26:24,680 See if that macaroni has got more momentum now or if they're still stuck with their leak being a little bit like, oh, okay, so that's the same offset value dump. 424 00:26:24,680 --> 00:26:27,100 So they're just dumping out a bunch of stack values, essentially. 425 00:26:27,100 --> 00:26:27,620 Right. 426 00:26:27,660 --> 00:26:32,180 Trying to figure out... You can see that they're looking at these, like, 7F value. 427 00:26:32,180 --> 00:26:34,520 They're probably interested in that one. 428 00:26:34,580 --> 00:26:36,740 Looking at the corresponding offset. 429 00:26:38,100 --> 00:26:38,780 Yeah. 430 00:26:39,000 --> 00:26:43,520 You can see here the AAC offset copying this, I guess. 431 00:26:45,020 --> 00:26:47,160 And it looks like they already had that there. 432 00:26:47,160 --> 00:26:51,000 So it's like, yeah, maybe they wonder, like, why is this not doing the thing? 433 00:26:51,000 --> 00:26:53,600 And, you know, are they going the wrong direction, like, up or down? 434 00:26:53,600 --> 00:26:56,620 You gotta remember, like, which stack goes one way, but the bytes go the other way. 435 00:26:56,620 --> 00:26:58,480 And that can be tricky. 436 00:26:58,580 --> 00:26:59,100 Right. 437 00:27:01,060 --> 00:27:06,620 And then... This challenge definitely gives you all the tools, though, that you need to solve it. 438 00:27:06,620 --> 00:27:09,460 It's just a matter of, like, wiring them up the right way. 439 00:27:12,420 --> 00:27:16,520 So, yeah, it didn't even send in eight bytes on that unpack. 440 00:27:17,500 --> 00:27:18,000 Right. 441 00:27:18,000 --> 00:27:31,480 Adding an interactive call, which is a nice feature in PwnTools, where, like, you can do some automation and then, like, take over with manual... Which works really well on a service like this, where it's the sort of text-based interactive thing. 442 00:27:31,480 --> 00:27:31,480 Right. 443 00:27:31,480 --> 00:27:36,660 And so maybe they want to just try to, like, leak a few more things or change what they're doing on the fly. 444 00:27:36,660 --> 00:27:37,220 Yeah. 445 00:27:38,440 --> 00:27:44,880 And so I'm trying to, like, read, you know, the different things. 446 00:27:44,880 --> 00:27:53,800 Basically, it seems like, basically, you know, they are using the payload to leak an address, use this address to calculate the base address. 447 00:27:53,800 --> 00:28:00,480 From this, they can construct a ROP chain, and then they are inserting this ROP chain. 448 00:28:00,780 --> 00:28:04,380 I do think we're coming up on first hint time as well. 449 00:28:04,420 --> 00:28:05,180 So we should... 450 00:28:05,180 --> 00:28:05,800 Right. 451 00:28:05,860 --> 00:28:08,400 We should talk about... Why don't you talk about how that process works. 452 00:28:08,400 --> 00:28:08,820 Right. 453 00:28:12,040 --> 00:28:14,080 So... So they did get the hint. 454 00:28:14,080 --> 00:28:16,180 Do they know to check the page? 455 00:28:16,180 --> 00:28:18,720 Why don't we go on over there and remind them about the hint schedule? 456 00:28:18,900 --> 00:28:22,120 So... I don't think we told them the hint schedule, so someone should go tell them. 457 00:28:23,040 --> 00:28:23,620 Right. 458 00:28:23,620 --> 00:28:31,760 So the way we do this is after 20 minutes of game time, we release a hint. 459 00:28:31,760 --> 00:28:33,800 On the same web page they downloaded the challenge on. 460 00:28:33,800 --> 00:28:33,800 Right. 461 00:28:33,800 --> 00:28:45,040 And then after another 15 minutes, we release a second hint, which I... Honestly, for this challenge, I don't think the hints... I'm not sure if it's going to help them. 462 00:28:45,040 --> 00:28:45,300 Yeah. 463 00:28:45,300 --> 00:28:46,040 Yeah. 464 00:28:46,080 --> 00:28:49,800 I don't think it's... it's helpful because I think they've already figured that part out. 465 00:28:49,800 --> 00:28:49,940 Right. 466 00:28:49,940 --> 00:28:55,660 I think they're now just fiddling around with, like, the offsets and, yeah, those parts. 467 00:28:56,380 --> 00:28:56,860 Yeah, I agree. 468 00:28:56,860 --> 00:28:59,400 I think we've seen that in the past, some of the challenges. 469 00:28:59,400 --> 00:29:00,380 Did we lose? 470 00:29:00,380 --> 00:29:01,320 No, we're still going. 471 00:29:01,440 --> 00:29:05,140 I've seen in the past in some challenges, the hints aren't really going to help you. 472 00:29:05,140 --> 00:29:09,220 You understand you've got all the right tools in the tool shop, but you're still having trouble building the chair. 473 00:29:09,220 --> 00:29:11,560 You've still got to, like, kind of put it together. 474 00:29:11,720 --> 00:29:12,500 So... Right. 475 00:29:12,560 --> 00:29:13,160 And here's interesting. 476 00:29:13,160 --> 00:29:17,720 We can see adding a, like, a red sled to their ROP chain. 477 00:29:17,720 --> 00:29:31,360 So, if you're familiar with, like, old school shell coding, you know, you sometimes could add, like, a NOP sled to, like, you know, if you didn't know exactly where your code was located, you would jump into this kind of long sequence of NOP instructions that would, 478 00:29:31,360 --> 00:29:35,960 like, then slide you all the way... No matter where you hit, they would all hit NOP and you would go to the very very end. 479 00:29:35,960 --> 00:29:35,960 Right. 480 00:29:35,960 --> 00:29:36,340 Yeah. 481 00:29:36,340 --> 00:29:38,620 Instead of trying to find the exact offset. 482 00:29:38,640 --> 00:29:51,840 And a red sled is, like, kind of the equivalent thing, but for a ROP chain, where if you don't know exactly how your ROP chain is going to offset on the stack, you just have a sequence of RET instructions that just progresses the ROP chain further without making any state changes . 483 00:29:51,840 --> 00:29:57,100 Or specifically a pointer to a return instruction from something you know at a fixed location . 484 00:29:57,100 --> 00:29:57,280 Yeah. 485 00:29:57,280 --> 00:30:04,260 And all those pointers in a row, so that no matter where you hit in a return, you'll just keep returning until you get to your next gadget that you want. 486 00:30:04,260 --> 00:30:04,840 Yep. 487 00:30:05,640 --> 00:30:08,840 Let's go back to PigBetSAD. 488 00:30:08,980 --> 00:30:16,600 We can see that they are... feels like they're still messing around with, like, the initial payload. 489 00:30:16,760 --> 00:30:25,080 Kind of this program that you are submitting to the automaton, to the VM. 490 00:30:25,820 --> 00:30:40,220 Maybe they're, you know, trying around a little bit with how long the various sequences of push and pop instructions need to be for this to all work the way they have, you know, they expect it. 491 00:30:41,140 --> 00:30:44,880 Now I do see, let's talk, there's U, O, and H. 492 00:30:44,920 --> 00:30:49,200 We saw those, and they've even labeled the O as output. 493 00:30:49,200 --> 00:30:56,840 So presumably this is going to be, these are like text instructions that we're sending into the virtual machine, and that's going to be what does our pushing or popping? 494 00:30:56,840 --> 00:31:10,300 Yeah, so each, you send a sequence of commands, each of them is like one character, and then followed potentially by some input or outputs that you get back. 495 00:31:11,380 --> 00:31:15,680 So we can actually see... Ah, there we go, they just refreshed for the hints. 496 00:31:17,020 --> 00:31:18,740 Yeah, and they saw the hint. 497 00:31:18,740 --> 00:31:20,660 It was too quick, it was keep popping something something. 498 00:31:20,660 --> 00:31:28,380 Right, keep popping beyond the bounds or something, which as I said, they figured that out a long time ago. 499 00:31:30,400 --> 00:31:45,260 So yeah, you know, not very helpful in this case, which is like, you know, good and bad, because it means that, you know, they have had some progress, and they have another 25-30 minutes, basically. 500 00:31:45,300 --> 00:31:48,000 Total time, I think, yeah, we have still another... 501 00:31:48,000 --> 00:31:53,660 Right, well, until the sudden death, we have to actually, we have to go back and look at and turn over the exact start time. 502 00:31:53,660 --> 00:31:55,040 So yeah, somebody wrote that down. 503 00:31:56,420 --> 00:32:01,440 So yes, we definitely got started late, and the being late was definitely our fault and not theirs. 504 00:32:01,440 --> 00:32:02,620 They were all here on time. 505 00:32:02,620 --> 00:32:08,580 That was just us, as you heard or saw us getting our, fixing our microphones and fixing all sorts of fun stuff. 506 00:32:08,580 --> 00:32:10,300 It was a mess, but we are here. 507 00:32:10,300 --> 00:32:14,580 It's working, so far it's working, and we already got one solved, and hopefully we'll see another one soon. 508 00:32:14,580 --> 00:32:23,580 Yep, yep, and yeah, big but sad, still messing around with, like, the payload structure here. 509 00:32:23,580 --> 00:32:29,940 The, you know, they're padding out there with these O instructions to a fixed size payload. 510 00:32:30,160 --> 00:32:32,740 Oh, I saw something interesting there. 511 00:32:32,740 --> 00:32:34,700 I want to go back to Macaroni. 512 00:32:34,700 --> 00:32:38,380 They were doing some more leaking there, I think. 513 00:32:38,380 --> 00:32:42,640 I saw some sequence of bytes popping out. 514 00:32:42,660 --> 00:32:44,940 Could have been interesting. 515 00:32:47,080 --> 00:33:00,740 Like, they, let's see, they go back here to this, to the, yeah, you know, they changed the size of the, you know, the code that they're sending, or the the length of these. 516 00:33:00,740 --> 00:33:02,000 The total, total payload. 517 00:33:02,000 --> 00:33:10,960 Yeah, and then, oh, this seems like they kind of, you know, they've subtracted eight in one place, and maybe they're compensating down here as well. 518 00:33:11,720 --> 00:33:25,200 I don't know exactly what these various offsets are, but it's, it's so weird, because we saw that libc leak real early on, and then I feel like we have kind of gotten stalled. 519 00:33:25,200 --> 00:33:27,560 We haven't really made it anything past that. 520 00:33:28,140 --> 00:33:39,060 So, yeah, it's, I'm really, you know, like, rooting for these teams to succeed with these things. 521 00:33:39,060 --> 00:33:45,440 I know how, like, frustrating it can be when you are, you know, trying to solve one of these challenges. 522 00:33:45,440 --> 00:33:48,080 And when we were testing this, we don't have the time pressure, too, right? 523 00:33:48,080 --> 00:33:57,280 So, like, we definitely had it easier that we could, yeah, put it down and walk away, think, get some fresh ideas, come back later, and think, oh, I bet I was messing up that, you know, go sleep on it, or whatever. 524 00:33:57,280 --> 00:34:06,920 Yeah, I was, like, you know, I was solving the challenge on one screen, and, like, watching some Twitch stream on the other screen, and, I mean, obviously that, you know, I didn't solve it in 45 minutes then. 525 00:34:06,920 --> 00:34:07,720 Yeah, for sure. 526 00:34:07,720 --> 00:34:10,020 Or even the 25 or whatever, the 20 minute one. 527 00:34:10,020 --> 00:34:11,240 Oh, no, no, no. 528 00:34:11,240 --> 00:34:12,980 From Hypeboy, that was great. 529 00:34:12,980 --> 00:34:15,780 Really, really impressive work there. 530 00:34:16,840 --> 00:34:18,560 So, yeah. 531 00:34:18,560 --> 00:34:32,920 I think the kind of benchmark we had throughout the development process was that, like, if we can solve it within, like, two hours in, like, a relaxed setting, then... Because, one, these players are all better than us. 532 00:34:32,920 --> 00:34:33,260 Yes. 533 00:34:33,260 --> 00:34:36,500 And every one of them are better than every one of us, I think, is probably fairly safe to say. 534 00:34:36,500 --> 00:34:36,900 Yeah. 535 00:34:36,900 --> 00:34:42,520 And then, two, again, we weren't kind of in a hurry, we were taking our time, and then not feeling rushed. 536 00:34:42,520 --> 00:34:44,220 Although, it works conversely, too. 537 00:34:44,220 --> 00:34:45,120 The opposite also works. 538 00:34:45,120 --> 00:34:51,160 The fact that we were not time pressured sometimes means that you had less stress in doing it, so. 539 00:34:51,580 --> 00:34:52,160 Yeah. 540 00:34:54,660 --> 00:35:07,960 I'm going to switch over again here to PigButSad, and... It does crack me up every time I see a bunch of, like, uuuh... How do you pronounce that exactly? 541 00:35:10,940 --> 00:35:11,620 Yeah. 542 00:35:11,660 --> 00:35:17,540 They're, again, like, messing with the various sizes of the parts of the payloads. 543 00:35:19,000 --> 00:35:34,100 Yeah, look, and you can see there, that's the address of the... when they call the interpreter, so it's setting a breakpoint when going into the interpreter to, you know, investigate exactly what's going on there. 544 00:35:35,520 --> 00:35:46,180 Yeah, it's still... I mean, if I were to, you know, bet at this point, I'm a little bit with Macaroni. 545 00:35:46,180 --> 00:35:46,600 Yeah. 546 00:35:46,600 --> 00:35:49,180 Yeah, I mean, it certainly had progress early on. 547 00:35:49,180 --> 00:35:55,820 I don't think we've yet to see a successful, like, libc leak out of PigButSad, unfortunately, yet. 548 00:35:55,820 --> 00:35:56,380 Yeah. 549 00:35:56,480 --> 00:35:58,120 Although, it could have happened, we just missed it, too. 550 00:35:58,120 --> 00:35:59,020 That happens a lot, as well. 551 00:35:59,020 --> 00:36:00,480 It's hard to track everything. 552 00:36:02,820 --> 00:36:14,200 But with, you know, the nature of these challenges is that, you know, if one team gets stuck, the other one can definitely catch up and, you know, cruise through and steal the win. 553 00:36:14,200 --> 00:36:15,400 So, you know... 554 00:36:15,400 --> 00:36:17,220 It is still anyone's game, for sure. 555 00:36:17,220 --> 00:36:17,720 Yeah , yeah , yeah, for sure. 556 00:36:17,720 --> 00:36:20,200 Just getting progress here from either one. 557 00:36:22,340 --> 00:36:39,060 Yeah, and this definitely lends itself to, I feel like, a more dynamic approach, this type of challenge, where you've got this primitives that you can just poke at and see what they do, see what you get on the stack, and just try a write and then go look at the stack after you've done your write. 558 00:36:39,960 --> 00:36:46,460 So, I remember, I think, what I did was, like, you know, I read the code and got, like, a rough sense of it. 559 00:36:46,460 --> 00:36:50,320 Like, you get that rough... the size of the buffer is, like, hex 800 or something. 560 00:36:50,320 --> 00:36:57,160 So, I started out with that as, like, a base thing, did something, then looked in the debugger, and then made adjustments. 561 00:36:57,160 --> 00:37:02,040 It's very similar to what I feel like the players are doing here. 562 00:37:03,200 --> 00:37:06,480 But, yeah, it's gonna be... 563 00:37:06,480 --> 00:37:07,180 So, that was interesting. 564 00:37:07,180 --> 00:37:12,840 We saw that, like, I mean, times 100 makes sense if we're pushing or popping eight bytes at a time, right? 565 00:37:12,920 --> 00:37:14,600 If it's an eight byte stack. 566 00:37:14,780 --> 00:37:18,480 But we had three use in a row times 100. 567 00:37:19,260 --> 00:37:23,500 So, I'm not sure if that was just, you know, do more just to... 568 00:37:25,280 --> 00:37:26,480 Yeah, I'm not sure about that. 569 00:37:26,480 --> 00:37:29,320 Like, three seems like a bit of an odd number. 570 00:37:29,780 --> 00:37:30,960 Three times hex 100. 571 00:37:30,960 --> 00:37:34,240 Yeah, like, if it was two or four, maybe. 572 00:37:34,240 --> 00:37:38,460 But, yeah, I don't know about that one. 573 00:37:43,250 --> 00:37:43,730 It's... 574 00:37:44,830 --> 00:37:48,830 You can tell the teams are a little bit ready for live CTF, though. 575 00:37:48,830 --> 00:37:54,630 We saw them come in with, like, this starter shell scripts with their alias macros or whatever. 576 00:37:54,630 --> 00:38:02,350 We've got two people very familiar with PwnTools and with even the interactor. 577 00:38:02,350 --> 00:38:05,090 Now, is the interactive prompt, is that Jeff or... 578 00:38:05,810 --> 00:38:06,990 No, that's PwnTools. 579 00:38:06,990 --> 00:38:08,750 PwnTools has its own kind of interactive... 580 00:38:08,750 --> 00:38:09,390 Yeah, yeah, yeah. 581 00:38:09,390 --> 00:38:11,850 ...GDB session that has all the same kind of... 582 00:38:11,850 --> 00:38:12,310 Oh, no, no, no. 583 00:38:12,310 --> 00:38:14,370 The interactive is just, you know... 584 00:38:14,370 --> 00:38:14,790 Well, no, no. 585 00:38:14,790 --> 00:38:21,170 So, I know the PwnTools interactive, but on the right side, for example, on Macaroni now, they're looking at the debugging session, right? 586 00:38:21,170 --> 00:38:21,390 Right. 587 00:38:21,390 --> 00:38:31,910 So, here you can see that they're running PwnDebug, which adds all of these, like, nice colorings and extra plugins and stuff to GDB. 588 00:38:31,910 --> 00:38:40,890 So, I think there are, I would say, currently two big GDB kind of add-ons for exploit development. 589 00:38:40,910 --> 00:38:50,730 PwnDebug being one of them, and then Jeff, G-E-F, being the other one, both, you know, with their pros and cons and popular within the CTF community. 590 00:38:50,730 --> 00:38:57,470 So, they have a bunch of modules adding these, like , trying to interpret addresses. 591 00:38:57,470 --> 00:39:04,350 You can see these, like, various pointers with different colors, like, whether it's in the text segment or, you know, the stack and so on. 592 00:39:04,350 --> 00:39:13,730 Yeah, it definitely is easier to read when you can see those highlights, as well as even just seeing the register from the stack, as opposed to the default GDB interface, which is empty. 593 00:39:13,790 --> 00:39:19,210 Now, you will see these, like, stack printouts, where it will also, like, dereference the pointer. 594 00:39:19,210 --> 00:39:27,510 Like, it will say, like, this is a pointer to, you know, the heap, and it's pointing to this value, and things like this. 595 00:39:27,970 --> 00:39:30,050 And it can even do that, like, multiple times. 596 00:39:30,050 --> 00:39:40,210 Like, this is a pointer to the heap, pointing to another pointer to the heap, and so on, which can be very helpful in these situations when you're playing. 597 00:39:40,210 --> 00:39:44,110 So, I've been watching a thing about SAD, and it looks like they've changed their league. 598 00:39:44,110 --> 00:39:57,070 So, now they're trying to offset in... they've changed that hard-coded hex 100 to a hex 80, and they're using 80 U's, then, to look at it. 599 00:39:57,070 --> 00:39:58,930 Okay, so now we've got a whole bunch of... 600 00:40:00,250 --> 00:40:03,490 is that 5.7 or 7.5 on the stack? 601 00:40:03,550 --> 00:40:05,650 Oh, these are probably ASCII U's. 602 00:40:05,650 --> 00:40:10,350 So, I've probably seen their own payload on the stack, I think. 603 00:40:10,350 --> 00:40:14,450 So, if you look at whatever hex 75 is... yeah, lowercase u. 604 00:40:14,450 --> 00:40:16,610 So, you can see it right there. 605 00:40:16,790 --> 00:40:21,250 So, that is indeed them reaching their own buffer. 606 00:40:24,790 --> 00:40:33,650 And there are definitely, like, the sort of, like, finding your own buffer in, you know, in the memories is oftentimes a component of an exploit, right? 607 00:40:33,650 --> 00:40:45,130 We've got to, like... maybe you want to remove an old pointer from your thing so it can go further, or you want to write some... maybe you want to write bytes into your buffer that weren't writable in the original input, but you could do it with a virtual machine, 608 00:40:45,130 --> 00:40:48,010 or maybe you wanted to write some other metadata around your buffer. 609 00:40:48,010 --> 00:40:52,190 You know, there's a lot of things you could do by sort of, you know, finding that data. 610 00:40:52,190 --> 00:40:55,170 I think we're so used to, like, Git code execution. 611 00:40:55,270 --> 00:40:55,770 Right. 612 00:40:55,990 --> 00:40:59,950 But ultimately, the goal is, like, you know, there could be other steps along the way. 613 00:41:00,410 --> 00:41:03,470 And I want to switch back over to Macaroni here. 614 00:41:03,470 --> 00:41:07,510 We can see if they do it again, because I saw one thing they did, like, down there. 615 00:41:07,510 --> 00:41:11,250 You can see the ROP chain, and they have also, like, some A's appended to the ROP chain. 616 00:41:11,290 --> 00:41:13,670 And I saw that they were looking for that in the debugger. 617 00:41:13,670 --> 00:41:17,990 They pre-appended it as well with some A's, and ran it in the debugger, and they showed up. 618 00:41:17,990 --> 00:41:26,050 Let's see if this happens again, or if they, you know, were done with that particular step of their analysis. 619 00:41:26,050 --> 00:41:30,470 But I think it can be a pretty nice educational moment. 620 00:41:30,470 --> 00:41:32,450 You can see here, they're changing around the offset again. 621 00:41:32,450 --> 00:41:39,610 I think they maybe got something out from the thing that I just described, where they pre-appended it, they saw, like, the offset, and now they're making adjustments. 622 00:41:39,810 --> 00:41:41,770 So let's see here if we can see this. 623 00:41:43,790 --> 00:41:45,730 Okay, they quit out immediately. 624 00:41:45,730 --> 00:41:49,210 Okay, they forgot they had this dumper section, right? 625 00:41:50,090 --> 00:41:57,830 And they, you know, they, you know, have... this can also be, like, you know, a thing where you you start messing around with your exploit script. 626 00:41:57,830 --> 00:42:01,670 You put in various scaffolding, and then you remove it, or you forget to remove it. 627 00:42:01,670 --> 00:42:05,510 Yeah, you get worse off before you realize you've actually left something in. 628 00:42:05,510 --> 00:42:07,570 You've got to go back and, yeah, fix up. 629 00:42:07,670 --> 00:42:12,030 I definitely did that several times when playtesting my challenge. 630 00:42:15,980 --> 00:42:31,080 Well, so again, adjusting... I think we're actually past second hint time as well, although, again, I don't know if... I don't think there's anything we can tell them that they don't know about the binary in terms of how it works. 631 00:42:31,200 --> 00:42:41,940 It's really just a question of who's going to actually get the mechanics, iron out all the kinks, and I would be much more worried if we hadn't seen one solve already. 632 00:42:41,940 --> 00:42:46,540 But we do know, like, yeah, getting that one solve in is reassuring as an author. 633 00:42:46,540 --> 00:42:47,540 It is doable. 634 00:42:47,860 --> 00:42:54,580 We know it got done, but let's see if we end up needing a sudden death challenge for this one or not. 635 00:42:54,580 --> 00:42:58,920 So I think they're going back to remind the team, so we might see them pull up that hit page again. 636 00:42:59,100 --> 00:43:04,000 They're going to let them know that, hey, that you have gone past that 35-minute timer. 637 00:43:04,640 --> 00:43:09,340 Yeah, and I mean, I really want to see the teams succeed. 638 00:43:09,340 --> 00:43:10,080 Oh, we all do, yeah. 639 00:43:10,100 --> 00:43:18,260 And we also would prefer to not have to use one of our sudden death challenges. 640 00:43:18,400 --> 00:43:23,500 Let's say we have not prepared the challenges enough for sudden deaths for every match. 641 00:43:23,500 --> 00:43:28,040 No, no, but we also have done horribly wrong if we have to use it. 642 00:43:28,040 --> 00:43:29,640 Oh, I just saw a very interesting thing. 643 00:43:29,640 --> 00:43:31,720 You can see they're changing their thing here. 644 00:43:31,720 --> 00:43:33,220 They're changing the whole thing. 645 00:43:33,220 --> 00:43:39,980 They found the win function, and they were getting rid of the libc stuff. 646 00:43:39,980 --> 00:43:42,700 They were leaking the program base. 647 00:43:42,700 --> 00:43:46,740 They're changing it, and now let's see if they actually manage to do it. 648 00:43:47,040 --> 00:43:53,000 I think PigButt said it's going to be very sad if they just missed the win function, and that's the difference here. 649 00:43:53,000 --> 00:43:55,220 Yeah, let's see here. 650 00:43:55,220 --> 00:44:03,700 They are still having some kind of... oh, right, they forgot to rename the variable in one place. 651 00:44:03,880 --> 00:44:04,820 Is that a shell? 652 00:44:04,980 --> 00:44:10,640 No, it's a breakpoint in the GDB, so we'll see here. 653 00:44:10,820 --> 00:44:30,840 It could be so close, but they're having... it's the stress that causes tiny mistakes, and it's frustrating, but it feels like I can almost see the stress in the way the cursor moves. 654 00:44:30,840 --> 00:44:31,700 It's regenerating. 655 00:44:31,700 --> 00:44:37,300 Yeah, and they're thinking in their head, my opponent's seconds ahead of me. 656 00:44:37,300 --> 00:44:41,540 Right, and especially once you find something that's... It makes it easier. 657 00:44:41,540 --> 00:44:43,400 Really, it's like, oh no, I missed this. 658 00:44:44,380 --> 00:44:47,820 Obviously, the other team, they know about this. 659 00:44:47,820 --> 00:44:49,920 And yet, every indication is they do not. 660 00:44:49,920 --> 00:44:52,820 You get to see PigButt sad, honing in on that. 661 00:44:52,820 --> 00:44:53,660 But they don't know that. 662 00:44:53,680 --> 00:45:04,400 Ironically, given that they've spent the most time in IDA, I think, looking at it, they were really looking around that main loop and around the interpreter loop, so we haven't seen them. 663 00:45:05,520 --> 00:45:15,840 Yeah, you can see now they're just extending like spamming the win function, adding ref instructions, just trying to get this to work. 664 00:45:18,260 --> 00:45:20,680 Yeah, I feel... Oh, they have the shell. 665 00:45:20,680 --> 00:45:21,460 There's a shell. 666 00:45:22,240 --> 00:45:23,760 There's a shell for macaroni. 667 00:45:23,960 --> 00:45:27,540 So now they need to connect to that. 668 00:45:27,540 --> 00:45:28,720 Oh, they're going to throw it remotely. 669 00:45:29,140 --> 00:45:31,700 So now let's see if we have... This is looking like it. 670 00:45:31,700 --> 00:45:32,980 Copy pasting the address. 671 00:45:32,980 --> 00:45:34,140 They're doing remote. 672 00:45:34,880 --> 00:45:35,940 They have a shell. 673 00:45:36,080 --> 00:45:36,760 They do. 674 00:45:36,760 --> 00:45:37,940 Submitter. 675 00:45:37,940 --> 00:45:39,160 And then... 676 00:45:39,160 --> 00:45:40,200 Yep, that's it. 677 00:45:40,200 --> 00:45:42,680 Congratulations to Macaroni. 678 00:45:42,680 --> 00:45:43,840 Great job. 679 00:45:43,840 --> 00:45:44,620 Very nice. 680 00:45:44,620 --> 00:45:46,380 Very nice, Macaroni. 681 00:45:47,060 --> 00:45:48,040 Yeah, let's... 682 00:45:49,980 --> 00:45:53,280 If I can pull up the right sheet. 683 00:45:53,280 --> 00:45:54,500 There we go. 684 00:45:54,500 --> 00:46:04,120 So that was our first round of matches here at the live CPF from the DEF CON CPF finals. 685 00:46:05,840 --> 00:46:08,240 And yeah, I think maybe we didn't mention this. 686 00:46:08,240 --> 00:46:18,180 So live CPF is part of the DEF CON CPF, where you have 12 of the best CPF teams across the world playing in like a big attack-defense competition against each other. 687 00:46:18,180 --> 00:46:20,520 And it's like a sub-event within this. 688 00:46:21,220 --> 00:46:30,220 They play this live CPF, like a one-on-one competition, where the results from this will then give them points that feed into the main event. 689 00:46:30,220 --> 00:46:39,980 So the total points they're going to get are going to range from about 1,337 the elite point range in the first place, all the way down to 500 points for the last place team. 690 00:46:39,980 --> 00:46:42,540 So every team who participates gets points. 691 00:46:42,540 --> 00:46:46,040 That way nobody can skip out and not send somebody to try to play. 692 00:46:46,040 --> 00:46:54,860 We wanted... I'm glad Nautilus Institute, who are the organizers of the main CTF, encouraged teams to participate by... there is a participation award for even doing this. 693 00:46:54,860 --> 00:46:56,240 Because it is brave. 694 00:46:56,240 --> 00:47:00,540 It is stressful to get up and be willing to let people talk about what you're doing. 695 00:47:00,540 --> 00:47:02,960 So yeah, we're glad that they did that. 696 00:47:03,060 --> 00:47:06,720 We're going to go ahead and get set up for the next match, which is going to be coming shortly. 697 00:47:07,220 --> 00:47:12,060 Yeah, because we are... since we are a little bit behind the schedule, we will get this going as soon as possible. 698 00:47:12,060 --> 00:47:12,980 We'll go to... 699 00:47:12,980 --> 00:47:15,300 we'll bring up some like intermission slides. 700 00:47:16,200 --> 00:47:18,300 And yeah, we will be right back. 701 00:47:18,500 --> 00:47:19,200 Don't go anywhere. 702 00:47:19,200 --> 00:47:19,920 As soon as we get ready. 703 00:47:19,920 --> 00:47:20,300 Take care. 704 00:47:20,300 --> 00:47:20,840 See ya.