[00:17.250 --> 00:21.050] Welcome back, CTF fans. I'm Mark and this is Josh. [00:21.150 --> 00:24.330] And we're back with the semifinals on the top bracket. [00:24.330 --> 00:28.870] Oh my goodness. It's been crazy. Both these teams undefeated so far. [00:29.170 --> 00:31.930] Yeah, really impressive given the level of competition that we've seen. [00:31.930 --> 00:35.330] We've got Hypeboy versus Straw Hat. I think this is going to be a good one. [00:35.330 --> 00:36.530] And you wrote this challenge, right? [00:36.530 --> 00:41.730] I wrote this challenge. It's my hardest challenge that I wrote. I'm allowed to say that. [00:42.370 --> 00:46.210] I think it's going to be really good though. Both these teams are fantastic. [00:46.210 --> 00:49.450] Alright, well I'm excited to see them get at it. So let's count it down. Ready? [00:49.450 --> 00:50.330] Let's do the countdown. [00:50.630 --> 00:56.050] In 5, 4, 3, 2, 1, go. [00:56.050 --> 00:57.130] Let's go. [00:58.690 --> 01:04.830] Alright, so we have on your top right, is that Straw Hat? [01:05.650 --> 01:06.110] Hypeboy. [01:06.110 --> 01:09.870] Did I get backwards? Ah, top right is Hypeboy, top left is Straw Hat. That's right. [01:10.430 --> 01:12.250] At this point it looks pretty similar, right? [01:12.250 --> 01:19.690] The first step of every challenge, download the challenge. Looks like we're having a little bit of a technical issue here. [01:19.690 --> 01:25.930] So we're going to take a look at what's going on with this. [01:27.330 --> 01:29.390] Okay, false start. [01:29.730 --> 01:33.950] You know, there's a lot of moving parts here and it takes a lot to get this going. [01:33.950 --> 01:39.790] It really is impressive to have a show running with everything that's going on here. [01:39.790 --> 01:45.450] A lot of moving pieces. I'm glad that we've had a lot of understanding on parts of Confedors. [01:47.470 --> 01:48.670] It's a challenge. [01:48.850 --> 01:51.530] It is a challenge, or it will be a challenge soon at least. [01:51.790 --> 01:53.670] Honestly, I blame the challenge author. [01:53.970 --> 01:57.310] You know, I said that going into this and here we are. [01:57.590 --> 02:00.810] Look, all my other ones work totally fine. [02:01.970 --> 02:05.450] Yeah, you know, but I think that it goes to show that... [02:05.990 --> 02:08.070] How many matches have we had so far? [02:08.070 --> 02:12.810] Oh my gosh. So we're in Grand Finals. We've had 10. [02:14.790 --> 02:18.510] So with that many challenges, you're bound to run into some bumps. [02:18.510 --> 02:27.610] And we've had a number of difficulties from infra, hardware, challenges needing to be updated on the fly. [02:27.610 --> 02:30.630] And there's so much work that goes on behind the scenes. [02:30.630 --> 02:33.450] We test everything as much as we can. [02:33.450 --> 02:36.290] We make sure that every challenge is solvable. [02:36.290 --> 02:39.610] Can somebody who's on the game network solve it? [02:39.610 --> 02:41.150] Is it reachable? Exactly. [02:41.150 --> 02:42.230] That's a big one. [02:42.230 --> 02:44.310] And there's just a lot of pieces. [02:44.310 --> 02:45.730] Yeah, there are a lot of pieces. [02:45.930 --> 02:47.950] And I think on this one... [02:49.090 --> 02:50.190] The what? [02:52.070 --> 02:53.270] Okay, so it sounds like... [02:53.270 --> 02:54.730] It's hyphens, not underscores. [02:57.730 --> 03:02.590] So I am the only person on the team that names things with underscores. [03:03.690 --> 03:05.070] Everyone else uses hyphens. [03:05.070 --> 03:06.950] And it looks like that caused the mix-up. [03:06.950 --> 03:10.450] So instead of the name of this challenge, we're allowed to say... [03:11.490 --> 03:12.750] We'll wait to say. [03:13.770 --> 03:14.150] But... [03:14.150 --> 03:15.990] Yeah, it's multiple words. [03:15.990 --> 03:17.350] I put underscores between them. [03:17.350 --> 03:18.210] It should be hyphens. [03:18.210 --> 03:19.710] Who's got time for a shift key? [03:20.510 --> 03:22.650] Honestly, who has time to not use a shift key? [03:22.750 --> 03:23.970] Why even use spaces? [03:23.970 --> 03:24.970] Yeah, I don't need numbers. [03:24.970 --> 03:25.950] I just need symbols. [03:27.070 --> 03:28.650] Why even use spaces? [03:28.790 --> 03:29.430] Yeah. [03:29.810 --> 03:31.530] Poland can use space. [03:31.750 --> 03:33.030] It's a hack-a-sack joke. [03:33.030 --> 03:33.650] Oh my gosh. [03:33.650 --> 03:35.290] Also another competition going on here. [03:35.290 --> 03:35.890] They're great. [03:35.890 --> 03:38.270] We have Jordan over there working on that right now. [03:38.910 --> 03:44.010] Yeah, it was a fierce rock-paper-scissors to see who was going to be able to commentate the finals. [03:44.010 --> 03:47.050] But Jordan, he is actually really good at rock-paper-scissors. [03:47.050 --> 03:48.770] Oh my gosh, a professional. [03:48.850 --> 03:49.850] I don't understand that. [03:49.850 --> 03:51.950] Well, he's doing rocket-paper-scissors right now. [03:51.950 --> 03:52.650] Oh my. [03:52.650 --> 03:53.370] Ha-ha! [03:53.470 --> 03:54.970] Oh, we have time before the challenge? [03:54.970 --> 03:56.250] We have time for bad jokes. [03:56.790 --> 03:58.030] I'll let you lead. [03:58.850 --> 03:59.510] Oh, I got nothing? [03:59.510 --> 04:00.290] That was my only one? [04:00.290 --> 04:01.130] Oh, okay. [04:01.130 --> 04:03.290] I guess now I'm the bad joke. [04:03.630 --> 04:04.490] Womp womp. [04:04.670 --> 04:12.570] You know, I see a lot of... you can't see this, but when we're looking out, what we're seeing is the DEF CON CTF finals floor. [04:12.570 --> 04:16.110] And it is a big dark room with a lot of people. [04:16.110 --> 04:18.570] And you know, I'm actually not seeing a lot of dual monitor use. [04:18.830 --> 04:25.550] You know there isn't, because a lot of being on the floor at DEF CON is just being able to pick up your laptop, go work wherever. [04:25.550 --> 04:27.530] Like, you're done being on the floor. [04:27.530 --> 04:28.890] You don't want to sit here anymore. [04:28.910 --> 04:30.070] You want to be the Chipotle guy. [04:30.070 --> 04:31.230] You want to go up to the suite. [04:31.230 --> 04:33.090] You want to, like, do anything else. [04:33.090 --> 04:38.290] You're tired of staring at this, like, stupid heap challenge. [04:38.770 --> 04:41.510] I, of course, not speaking from experience or anything. [04:42.010 --> 04:43.310] Yeah, well, I can relate. [04:43.310 --> 04:47.110] I'm very much a one screen guy because I just like to be able to set up wherever I am. [04:47.410 --> 04:49.070] Yeah, no, that's totally fair. [04:49.070 --> 04:54.810] And your awesome ergonomic setup, which, like, you set it down. [04:54.810 --> 04:56.670] You have a stand for your laptop. [04:56.670 --> 04:57.610] You have mouse. [04:57.610 --> 04:59.370] You have ergonomic keyboard and everything. [04:59.370 --> 05:01.650] I'm like, oh my gosh, this guy is a pro. [05:03.110 --> 05:07.810] I'm over here with my little laptop and my, like, 90 degree angled posture. [05:08.890 --> 05:12.010] It's just years of wrist rot, really. [05:12.010 --> 05:15.590] So it comes back to bite you if you don't take care of it up front. [05:15.590 --> 05:17.870] See, I don't get that because I don't use home rototype. [05:17.870 --> 05:20.650] I have my left hand on WASD and my right is just floating. [05:21.970 --> 05:24.210] I learned to type from playing video games. [05:24.210 --> 05:25.030] What can I say? [05:25.690 --> 05:27.430] Maybe speak and tell me how to type. [05:27.630 --> 05:28.270] What to? [05:29.010 --> 05:30.470] Old typing program. [05:30.470 --> 05:31.730] Oh, God. [05:31.730 --> 05:33.310] No, am I showing my age? [05:35.030 --> 05:36.870] And I think we're getting close here. [05:36.870 --> 05:38.550] We're getting close to ready here. [05:38.650 --> 05:41.370] But we're good to go? [05:43.270 --> 05:46.110] I think we're just making sure that the connectivity is up. [05:46.110 --> 05:46.130] All right. [05:46.130 --> 05:49.070] I think we're good to go with not a false start. [05:49.830 --> 05:50.410] Okay. [05:50.410 --> 05:53.410] So without further ado, for real this time, that was just a practice. [05:53.490 --> 05:57.810] In 5, 4, 3, 2, 1. [05:57.810 --> 05:58.150] Let's go. [05:58.150 --> 05:59.630] Let's go for real, please. [06:01.730 --> 06:02.370] Oh. [06:02.950 --> 06:03.430] Okay. [06:03.430 --> 06:04.610] They download the challenge. [06:04.610 --> 06:07.570] I see the happy bouncing box on the Mac. [06:09.790 --> 06:10.310] Yeah. [06:10.310 --> 06:11.370] They download the challenge file. [06:11.370 --> 06:12.390] I see something in IDA. [06:12.390 --> 06:15.590] If you just screen dash R or whatever, or I can take care of it. [06:15.790 --> 06:16.470] Okay. [06:17.130 --> 06:17.550] So... [06:17.550 --> 06:18.010] All right. [06:18.010 --> 06:21.190] Now we see that beautiful challenge name popping out there. [06:21.190 --> 06:22.310] We see the beautiful challenge. [06:22.310 --> 06:23.430] Oh, House of Barbie. [06:23.430 --> 06:25.530] I'm so proud of this challenge name. [06:25.530 --> 06:29.350] This came from another challenge name that Carl came up with originally. [06:29.350 --> 06:32.930] I made this as a follow-up joke, and I'm like, damn, I need to write that. [06:32.930 --> 06:36.750] So House of Barbie is a custom heap allocator challenge. [06:37.670 --> 06:41.810] Everyone's familiar with the, like, House of Spirit, House of Force, and all that. [06:42.370 --> 06:45.130] So House of Barbie was the natural follow-up. [06:46.290 --> 06:50.030] So this is, you know, in my book, a custom heap allocator. [06:50.030 --> 06:52.470] That doesn't sound like an easy challenge to me. [06:52.890 --> 06:53.950] It's simple. [06:53.950 --> 06:55.230] We don't do TCache. [06:55.230 --> 06:56.490] We don't do different bins. [06:56.490 --> 06:57.530] We throw everything. [06:57.530 --> 07:00.190] We use Sbreak, and we just send it. [07:00.190 --> 07:01.750] You know, everything is sequential. [07:01.750 --> 07:04.650] If it isn't sequential, oops, memory's bad. [07:05.690 --> 07:06.610] Well, you know what? [07:06.610 --> 07:08.370] Writing memory allocators is hard. [07:08.370 --> 07:08.670] Yeah. [07:08.670 --> 07:10.090] Who remembers how to do that? [07:11.930 --> 07:15.290] So let's jump in and take a look at our competitors here. [07:15.650 --> 07:18.750] So Hypoi launching into it first, going through. [07:18.750 --> 07:20.250] It's fairly simple. [07:20.250 --> 07:22.330] So what you have is you have a house. [07:22.770 --> 07:24.290] This is going to sound so weird. [07:24.290 --> 07:25.130] Keep going, Josh. [07:25.130 --> 07:26.190] You have a house. [07:26.190 --> 07:27.750] There are rooms in the house. [07:27.750 --> 07:29.070] There's furniture in the rooms. [07:29.070 --> 07:30.510] You make your dream house. [07:30.510 --> 07:33.290] I think the description of the challenge was, like, [07:34.390 --> 07:38.890] Stidlib Malik wasn't pink enough, so we implemented our own, [07:38.890 --> 07:40.810] which also the description. [07:41.270 --> 07:42.930] For those that haven't seen the Barbie movie, [07:42.930 --> 07:44.690] this is going to be totally over your head. [07:44.690 --> 07:47.170] But those that have, I really hope you're laughing. [07:49.370 --> 07:51.950] I heard a groan from production. [07:51.950 --> 07:56.970] So going through, we have very nice functions here. [07:56.970 --> 07:59.550] Print state, it was supposed to be behind debug, [07:59.550 --> 08:00.750] but that was actually a little hard, [08:00.750 --> 08:03.290] so I just commented out the debug condition. [08:03.330 --> 08:05.530] Print state prints each room in the house, [08:05.530 --> 08:07.570] each furniture item in the room, and why not? [08:07.570 --> 08:09.170] It prints all the heap chunks, too. [08:09.530 --> 08:12.370] Heap chunk printed with the address of it, [08:12.370 --> 08:13.950] the data address of it, size of it, [08:13.950 --> 08:15.770] whether it's free or not, and the next. [08:15.770 --> 08:18.090] So the heap here is a singly linked list, [08:18.090 --> 08:20.770] which we're going to see so much in CTFs. [08:20.770 --> 08:22.970] It's one of the most common data structures you see [08:23.690 --> 08:25.970] because that next pointer is just so valuable, [08:25.970 --> 08:27.170] especially in heap challenges. [08:27.170 --> 08:28.870] You might be able to get an arb right from it [08:28.870 --> 08:30.050] if you try hard enough. [08:30.330 --> 08:33.170] Yeah, so definitely when I was looking at this challenge, [08:33.170 --> 08:35.190] I was thinking, all right, what is the metadata [08:35.190 --> 08:36.730] that we're going to see in the chunks? [08:36.730 --> 08:38.430] How are these chunks laid out? [08:38.430 --> 08:40.410] The print function that you mentioned [08:41.610 --> 08:43.710] really does help you understand that, [08:43.710 --> 08:46.070] and I'm interested to see when the competitors [08:46.070 --> 08:47.910] stumble across that, and we'll be able to tell [08:47.910 --> 08:50.850] because there'll be some addresses being printed out. [08:50.850 --> 08:53.530] Yeah, no, it looks like Hypoi is doing that. [08:53.530 --> 08:55.050] They're not annotating with it quite yet, [08:55.050 --> 08:57.030] but Straw Hat is. [08:57.210 --> 08:59.450] Straw Hat has already gone through and annotated [09:00.530 --> 09:03.070] part of the heap struct, I believe, [09:03.070 --> 09:04.910] or maybe they're just in the furniture struct still. [09:04.910 --> 09:06.530] Yeah, so that's the globals. [09:06.530 --> 09:11.470] There's some global metadata that manages the heap [09:11.470 --> 09:16.810] as well as, I believe, the house structure. [09:16.810 --> 09:20.410] The house struct is in globals. [09:20.410 --> 09:20.850] Yep. [09:21.290 --> 09:22.870] So that's easy to keep track of. [09:22.870 --> 09:24.110] It's one less layer of indirection, [09:24.110 --> 09:26.630] one less allocation you need to keep track of on the heap. [09:27.670 --> 09:30.550] And both teams we're going to see going through [09:30.550 --> 09:32.950] just doing basic annotation of this. [09:32.950 --> 09:34.030] We talked about this earlier, [09:34.030 --> 09:36.550] but this is a really good way to just get your bearings [09:36.550 --> 09:38.850] in a challenge that has a couple layers to it [09:38.850 --> 09:42.490] because you have the house, you have rooms, [09:42.490 --> 09:44.310] and you have furniture, and all of those [09:44.310 --> 09:45.570] are different structs. [09:45.570 --> 09:49.410] Right, and correct me if I'm wrong here, Josh, [09:49.410 --> 09:52.710] but I think that the structs themselves, [09:52.710 --> 09:55.090] not in the binary, they're going to have to reconstruct that. [09:55.090 --> 09:57.710] They've got hints based on strings that are in it [09:57.710 --> 10:01.350] and the menu sort of saying add room, add furniture, [10:01.350 --> 10:02.790] but they're still going to do a little bit [10:02.790 --> 10:05.070] of struct reconstruction. [10:06.050 --> 10:08.030] Reconstruction, nice. Got it, got it. [10:08.910 --> 10:10.830] Yeah, they are reconstructionists. [10:10.830 --> 10:11.750] Yep, yep. [10:12.050 --> 10:14.630] And we've talked about this before, [10:14.630 --> 10:17.230] but again, common theme, we've got a menu here. [10:17.430 --> 10:18.970] We've got one competitor who looks like [10:18.970 --> 10:21.390] they're very static focused, [10:21.390 --> 10:23.650] so they're looking at each menu item, [10:23.650 --> 10:25.590] they're reading the function that gets called. [10:25.590 --> 10:27.030] The other competitor looked like they were [10:27.030 --> 10:29.930] exploring the menu via just sending stuff to it. [10:30.590 --> 10:32.550] Yeah, and it looks like they're just trying [10:32.550 --> 10:33.970] to get interaction down, and they're trying [10:33.970 --> 10:36.010] to print the state of the heap [10:38.710 --> 10:40.690] after each of those interactions. [10:40.690 --> 10:43.630] And what's really nice is these structs are, [10:43.630 --> 10:45.630] you know, I might have been a little nice here [10:45.630 --> 10:49.010] and made them divisible sizes. [10:49.430 --> 10:50.570] Always helpful. [10:50.890 --> 10:53.270] You might be able to just kind of [10:53.270 --> 10:56.690] shove a couple of one in the space of another, [10:56.690 --> 10:59.190] and the link list I might have forgotten to free, [10:59.190 --> 11:01.490] so you might have a couple free chunks [11:01.490 --> 11:03.170] here and there you can control. [11:04.590 --> 11:08.170] But really, this challenge was [11:09.090 --> 11:11.030] inspired by the name, obviously. [11:11.030 --> 11:12.450] And then when I started looking up, [11:12.450 --> 11:14.630] I was like, oh, what do people do for custom heap allocators? [11:14.630 --> 11:17.670] I looked through a bunch of GitHub repos, [11:17.670 --> 11:19.670] and all of them I found bugs. [11:19.870 --> 11:22.070] Every single one had a mistake. [11:22.070 --> 11:22.810] At least one. [11:23.010 --> 11:24.470] As I said, it's hard. [11:24.470 --> 11:25.710] Yeah, it is. [11:25.710 --> 11:29.670] So I kind of pulled the bug inspired by one of those. [11:29.670 --> 11:32.430] Not exactly the same, but kind of the idea of it [11:32.430 --> 11:34.130] because I'm like, wow, yeah, people can really [11:34.130 --> 11:36.770] make this mistake. This is kind of a real bug. [11:36.770 --> 11:38.610] Well, so it's interesting you say that [11:38.610 --> 11:40.270] because I think that a surprising number [11:40.270 --> 11:42.910] of the challenges that we've seen, [11:42.910 --> 11:44.730] both here and in other CTFs, [11:44.730 --> 11:46.910] are usually modeled after a real bug [11:46.910 --> 11:48.270] that someone else has found. [11:48.270 --> 11:50.490] And sometimes it is literally just, [11:50.490 --> 11:52.990] here's that software with this bug that I found in it. [11:52.990 --> 11:54.390] You find the bug too. [11:54.430 --> 11:54.730] Exactly. [11:54.730 --> 11:55.730] In some CTFs. [11:56.090 --> 11:58.370] Certainly some of the challenges that we've seen [11:58.370 --> 12:00.090] in this competition, I know at least one of the ones [12:00.090 --> 12:02.030] that I wrote was based on a real-world bug [12:02.030 --> 12:04.250] with a weird primitive. [12:04.510 --> 12:06.090] And I thought, hey, it would be really cool [12:06.090 --> 12:08.130] to see the challengers try their hands at this. [12:08.130 --> 12:09.390] Yeah, absolutely. [12:09.390 --> 12:11.330] And I remember I was playing in [12:11.330 --> 12:13.490] real-world CTF 20... [12:13.490 --> 12:15.930] Oh, the first one. Whenever that was. [12:16.750 --> 12:17.150] And... [12:17.150 --> 12:19.190] they had one challenge that was [12:19.750 --> 12:21.610] you know, recreate this [12:21.610 --> 12:23.450] ODE in Chrome. Oh, by the way, [12:23.450 --> 12:24.890] don't worry, we actually have it. [12:25.110 --> 12:27.930] You're not giving us an ODE. We already have it, guys. Trust us. [12:27.930 --> 12:29.230] And they had a video of them [12:29.230 --> 12:31.430] showing the ODE, which was just them [12:31.430 --> 12:33.450] running a script, then Chrome popped up, then Calc [12:33.450 --> 12:35.150] popped up, and I'm like, dude, that doesn't prove anything. [12:35.150 --> 12:36.830] You could just call Calc. [12:36.830 --> 12:39.670] Print random addresses and call Calc. [12:39.690 --> 12:40.950] So, there are [12:40.950 --> 12:42.810] definitely real-world bugs that try [12:42.810 --> 12:44.850] to be put in CTF. Sometimes, it's [12:44.990 --> 12:46.950] a little shadier than others. We decided to not [12:46.950 --> 12:48.570] do that challenge because we're like, [12:48.570 --> 12:51.070] we don't know how we feel about this. [12:51.370 --> 12:51.970] Right. [12:52.310 --> 12:54.830] Yeah, I mean, they're in good company in terms of the [12:54.830 --> 12:56.970] number of proof videos out there [12:56.970 --> 12:58.430] that just popped up. [12:58.870 --> 13:01.090] Where it's just, you know, a script [13:01.090 --> 13:02.950] that's called, like, exploit.py, and inside [13:02.950 --> 13:06.010] of it, all of us is like, subprocess.calc.exe. [13:06.010 --> 13:08.010] Great exploit. One of my favorites. [13:08.010 --> 13:09.770] So, if we switch over here to [13:09.770 --> 13:12.050] Hypeboi, we can see that they're printing [13:12.050 --> 13:13.190] out the [13:14.750 --> 13:16.310] this is the list of the chunks, [13:16.310 --> 13:17.250] and these are the [13:19.150 --> 13:20.130] different... Yeah, these are all the [13:20.130 --> 13:22.530] field values. The fields in the chunks. [13:22.590 --> 13:24.230] So, it looks like [13:24.670 --> 13:26.010] three... oh, gosh. [13:26.050 --> 13:28.450] So, they're going to be creating a room. [13:28.830 --> 13:29.970] Yeah, creating a room [13:29.970 --> 13:32.290] and adding items to it. [13:32.850 --> 13:34.350] I have to say, I really [13:34.350 --> 13:36.510] especially for a challenge like this, [13:36.510 --> 13:38.290] I think it's great to have stuff like that because [13:38.290 --> 13:39.810] for me, [13:41.350 --> 13:41.750] having [13:42.190 --> 13:44.030] heap structure stuff in my head, [13:44.570 --> 13:46.270] even with nice printouts like that, [13:46.270 --> 13:48.530] it's hard. It is hard, definitely. [13:48.530 --> 13:50.490] And unless you're really familiar with the structures, [13:50.490 --> 13:52.370] like, you can hold tcache info in your head. [13:52.370 --> 13:54.310] With a custom heap allocator, like, you [13:54.310 --> 13:56.210] need to change your understanding and you're going to be making [13:56.210 --> 13:58.730] mistakes because fields are at different places. [13:58.890 --> 14:00.450] Fields don't exist. They're different [14:00.450 --> 14:02.870] sizes, different everything. [14:02.870 --> 14:05.150] So, having that printout is really, [14:05.150 --> 14:06.430] really beneficial [14:06.430 --> 14:09.350] to just being able to do this challenge, [14:09.350 --> 14:10.770] period, let alone in the time [14:10.770 --> 14:12.630] they're given. Yeah, and [14:12.630 --> 14:14.830] I think that one of the things that [14:14.830 --> 14:16.670] is tricky with a new heap [14:16.670 --> 14:18.590] allocator is, as you were talking about, [14:18.590 --> 14:20.590] it's nice that they're at [14:20.590 --> 14:22.630] good widths because with [14:22.630 --> 14:24.610] heap stuff, typically what you're looking to do is [14:24.610 --> 14:26.550] you have these boxes, right, [14:26.550 --> 14:28.650] and you're trying to get maybe one overlaid [14:28.650 --> 14:30.590] over the other or a little bit further into [14:30.590 --> 14:32.570] them, but you have to know exactly [14:32.570 --> 14:34.650] what that structure is to know what's being [14:34.650 --> 14:36.630] overwritten or what's being placed on top [14:36.630 --> 14:38.310] of a value that used to be there. [14:38.590 --> 14:40.570] Yeah, absolutely. Like, [14:40.570 --> 14:42.850] if you have two structs of the same size, one with a [14:42.850 --> 14:44.590] function pointer at the offset of the [14:45.250 --> 14:46.790] size field of the other one, [14:46.790 --> 14:48.810] you know, that's really nice. You get arb call on [14:48.810 --> 14:51.270] size field, but if you have [14:51.270 --> 14:52.950] mismatched sizes, you know, [14:52.950 --> 14:55.230] you get, uh-oh, that function pointer is now [14:55.790 --> 14:56.850] like next pointer in [14:56.850 --> 14:58.910] the heap metadata, and it's just so [14:58.910 --> 15:00.790] like it's probably [15:00.790 --> 15:02.370] still possible, but you have to do [15:02.830 --> 15:04.490] so much heap manipulation to get there [15:04.490 --> 15:07.250] that it's just not feasible within an hour. [15:07.250 --> 15:08.910] I'm sure everybody at home has exactly [15:08.910 --> 15:10.930] the picture in their head of what Josh [15:10.930 --> 15:12.610] was just talking about. I know [15:12.610 --> 15:15.030] it's very easy. This is [15:15.490 --> 15:16.470] child's play, surely. [15:17.570 --> 15:18.530] Okay. [15:20.210 --> 15:21.130] Let's take a [15:21.130 --> 15:22.930] look here and see what [15:22.930 --> 15:25.010] Straw Hat has going on. So [15:27.990 --> 15:28.470] Straw Hat... [15:28.470 --> 15:30.470] So right now they're breaking down. So this [15:30.470 --> 15:32.370] is the free function. So the allocator, it's [15:32.370 --> 15:34.470] essentially only three functions, right? Yeah. [15:34.470 --> 15:36.630] It's, uh, what is it? Free, [15:37.230 --> 15:38.350] malloc, and [15:38.350 --> 15:40.490] realloc. Yep. And I [15:40.490 --> 15:42.510] think looking at this, you just skipped [15:42.510 --> 15:44.890] over the malloc function because you're just like, [15:44.890 --> 15:46.430] oh, it's just malloc. [15:46.430 --> 15:48.490] And you were looking for straight, like, [15:48.490 --> 15:50.390] stdlib heap bugs. Yeah. [15:50.890 --> 15:52.410] Because... Yeah, I'm like, uh, double click [15:52.410 --> 15:54.390] on malloc, and you're like, [15:54.390 --> 15:56.350] you bastard. Yeah. [15:56.350 --> 15:58.350] If you look on the left-hand side there, you can very [15:58.350 --> 16:00.510] clearly see that the malloc, free, and realloc [16:00.510 --> 16:02.330] functions don't have that pink background [16:02.330 --> 16:04.610] on them. So they're not imports. [16:04.790 --> 16:06.390] Um, so I missed that [16:06.390 --> 16:08.530] because I, you know, little detail [16:08.530 --> 16:10.490] like that, and I was looking [16:10.490 --> 16:12.670] for the bug and didn't see it. [16:12.670 --> 16:15.230] It's a really common oversight. Honestly, [16:15.450 --> 16:16.270] a big part of this [16:16.270 --> 16:18.390] is, you know, going through [16:18.390 --> 16:20.210] with a fine-tooth comb [16:20.210 --> 16:22.590] and understanding every step of the process [16:22.590 --> 16:24.490] because if you make assumptions like that, you're going [16:24.490 --> 16:26.450] to be skipping over potentially major parts [16:26.450 --> 16:28.450] of program logic and potentially where the [16:28.450 --> 16:30.450] bug is. Right. Who knows? Right. And so I'm [16:30.450 --> 16:31.830] glad to see that our competitors [16:32.370 --> 16:34.630] did not fall for that like I did. Oh, my [16:34.630 --> 16:36.610] god. I was honestly worried [16:36.610 --> 16:38.890] and I was debating renaming them, and then I'm just like, [16:38.890 --> 16:41.030] nah, I like using these names. [16:41.670 --> 16:42.470] Uh, yep. And we can [16:42.470 --> 16:44.530] see that both competitors looking [16:44.530 --> 16:46.690] at these heap implementations. [16:47.450 --> 16:48.610] Yeah. Hypeboi also looking [16:48.610 --> 16:50.490] at realloc and free. Yeah. [16:50.650 --> 16:52.330] Hypeboi probably knows that [16:52.330 --> 16:54.350] realloc is usually pretty buggy [16:54.910 --> 16:56.230] because you need to [16:56.230 --> 16:58.210] split chunks, you need to be able [16:58.210 --> 17:00.650] to shift them, join them, [17:00.650 --> 17:02.310] etc. You know, that's all this does [17:02.310 --> 17:04.290] but other heap allocators, absolutely. [17:04.810 --> 17:06.450] Um, but you might notice [17:06.450 --> 17:07.910] that splitting the chunk [17:07.910 --> 17:10.370] isn't the job of realloc. [17:10.370 --> 17:12.270] Splitting the chunk happens in malloc. [17:12.790 --> 17:14.370] Yeah, I was going to say that depending on how [17:14.370 --> 17:16.370] you want to write your heap allocator, [17:16.370 --> 17:18.350] you could end up with some of [17:18.350 --> 17:20.670] these being pretty simple. [17:20.670 --> 17:22.110] So, realloc [17:22.810 --> 17:24.110] really could just be [17:24.750 --> 17:26.550] a thin wrapper around malloc and free if you [17:26.550 --> 17:28.930] wanted to, like if you wanted to be lazy. It was originally. [17:28.930 --> 17:30.790] Um, and free. [17:31.290 --> 17:32.230] I think that [17:32.230 --> 17:34.210] if you wanted to be lazy about it, [17:34.210 --> 17:36.490] you could do basically all the work in free [17:36.490 --> 17:38.430] and have it do the consolidation [17:38.430 --> 17:40.730] of chunks and malloc just be real lazy [17:40.730 --> 17:42.610] and just, do I have a big enough free [17:42.610 --> 17:44.610] slot? If so, yep, just take it. [17:45.310 --> 17:46.610] Okay, well, look. [17:46.610 --> 17:47.150] Sorry. [17:48.770 --> 17:50.510] Shade being thrown this way because that's [17:50.510 --> 17:51.750] kind of what it does. [17:52.990 --> 17:54.570] I mean, but despite that, look. [17:54.870 --> 17:55.750] Yeah. [17:56.370 --> 17:58.690] What are we looking at? We're looking at Hypeboy here. [17:58.950 --> 18:01.150] Um, yeah. [18:01.330 --> 18:02.810] Looks like they're [18:03.630 --> 18:04.510] cross-referencing [18:04.510 --> 18:05.430] those heap [18:06.650 --> 18:08.530] functions. See those calls to [18:08.530 --> 18:10.910] free there. Trying to figure out what goes inside of them. [18:10.910 --> 18:12.370] Exactly. I think once you [18:12.370 --> 18:14.470] understand that, okay, there might be a bug [18:14.470 --> 18:16.670] in one of the three allocator [18:16.670 --> 18:18.690] functions, the next step is probably, [18:18.690 --> 18:21.030] okay, where do each of these functions get used? [18:21.030 --> 18:23.010] Yeah. As far as I'm aware, [18:23.010 --> 18:24.170] the only bug in this program [18:24.170 --> 18:26.390] is in the heap allocator. [18:26.390 --> 18:28.390] It's very possible that there's another bug [18:28.390 --> 18:30.910] somewhere, like, I'm not a perfect programmer. [18:31.390 --> 18:32.510] And I would be delighted to [18:32.510 --> 18:34.530] see it because I've been saying [18:34.530 --> 18:36.130] this whole tournament [18:36.130 --> 18:38.550] that I want to see a challenger come up [18:38.550 --> 18:40.390] with an unintended solution because I know [18:41.150 --> 18:42.070] it's a possibility. [18:42.070 --> 18:44.050] We've had a little off from intended solution [18:44.050 --> 18:45.690] but we haven't had, you know, [18:45.690 --> 18:48.090] fully just wrong place, [18:48.090 --> 18:50.030] not where we expected at all. We thought this [18:50.030 --> 18:52.110] was sound. Like, I want to see [18:52.110 --> 18:54.210] someone just tear apart my code. [18:55.170 --> 18:55.730] Yeah, and [18:56.930 --> 18:58.210] especially for this [18:58.210 --> 19:00.150] one, which I think the intended solution [19:00.150 --> 19:02.170] in this one is, it's not simple, [19:02.170 --> 19:04.030] right? This is a tough challenge. [19:04.090 --> 19:06.190] Yeah. This is, I want [19:06.190 --> 19:08.090] to say, the hardest challenge I wrote for this. [19:08.450 --> 19:10.070] Both very good teams. We were saving it [19:10.070 --> 19:11.810] for later because we were worried that [19:12.270 --> 19:14.010] when players were just getting used to this, [19:14.010 --> 19:15.770] when players were still very nervous about [19:15.770 --> 19:17.630] competing, that [19:17.630 --> 19:19.910] they wouldn't solve it in time. But [19:19.910 --> 19:22.010] we're pretty confident that this won't [19:22.010 --> 19:24.550] go into sudden death, obviously, otherwise we wouldn't have fielded it. [19:25.390 --> 19:26.230] Yeah, a lot of quality [19:26.230 --> 19:27.790] control on our side is really [19:27.790 --> 19:29.950] focused on, is this hard but [19:29.950 --> 19:32.310] solvable? Yes, absolutely. [19:32.310 --> 19:34.070] So we've got a couple of levers that we [19:34.070 --> 19:35.770] can pull in this regard. We've got [19:35.770 --> 19:38.010] hints, we can add [19:38.010 --> 19:39.890] symbols or have [19:39.890 --> 19:41.830] explanatory stuff sort of sprinkled in. [19:41.830 --> 19:45.150] Oh yeah, and we've nerfed challenges, we've added win functions, [19:45.150 --> 19:45.750] we added [19:47.190 --> 19:47.690] unoptimized [19:47.690 --> 19:49.690] gadgets in there. [19:50.770 --> 19:51.930] And I'll also [19:51.930 --> 19:53.950] say that the sudden [19:53.950 --> 19:55.930] death challenges that we've seen so far [19:56.550 --> 19:57.950] weren't necessarily the ones that [19:57.950 --> 19:59.710] we thought were going to be the ones that would go the distance. [19:59.710 --> 20:01.970] Absolutely. I honestly chalk [20:01.970 --> 20:03.870] that up to nerves. Yes, [20:03.870 --> 20:05.790] this is truly a difficult [20:05.790 --> 20:07.750] situation to try to succeed in. [20:08.470 --> 20:09.790] Yeah, it's [20:09.930 --> 20:11.830] a different situation [20:11.830 --> 20:13.790] than these teams have been in before [20:13.790 --> 20:16.090] because they've competed in countless CTFs. [20:16.090 --> 20:17.630] They got here, [20:17.630 --> 20:19.790] they're used to being here, you know, you work in your [20:19.790 --> 20:21.610] team, every team has a little, almost [20:21.610 --> 20:23.830] enclave where they work [20:23.830 --> 20:25.410] with their teammates. And then [20:25.410 --> 20:27.830] you get over here, you're alone, you're [20:27.830 --> 20:29.750] against another team that you don't [20:29.750 --> 20:31.870] know the person potentially. You're on [20:32.850 --> 20:33.330] unfamiliar [20:33.330 --> 20:35.590] challenge. You have [20:35.590 --> 20:37.550] to use tools that you might have [20:37.550 --> 20:39.610] installed, you might need to download them. We saw with the [20:40.170 --> 20:41.450] LEB128 package that you [20:41.450 --> 20:43.630] needed to download the tool because no one had that [20:43.630 --> 20:45.330] obviously. I think MMM [20:45.330 --> 20:46.810] didn't end up using it, right? [20:47.210 --> 20:49.810] Oh, you're right. No, they didn't end up using it at all. [20:50.610 --> 20:51.490] But it [20:51.490 --> 20:53.330] just goes to show, like, [20:53.330 --> 20:55.270] it's a very different situation [20:55.270 --> 20:57.490] and the amount that plays into it just [20:58.470 --> 20:59.770] can't be overstated. [20:59.850 --> 21:01.390] Yeah, it's a different game and [21:01.390 --> 21:03.310] I have been in [21:03.310 --> 21:05.310] the CTF scene for a long time and one of the [21:05.310 --> 21:07.250] things that I picked up on after the first few [21:07.250 --> 21:09.470] years of playing is that it's really a [21:09.470 --> 21:11.570] big morale game. It's a psychological [21:11.570 --> 21:13.450] game. Do you feel like you have momentum? Do you [21:13.450 --> 21:15.610] feel like you're making progress? And this is [21:15.610 --> 21:18.110] a different situation. You're just behind this [21:18.110 --> 21:19.630] wall and it's just them back there. [21:19.630 --> 21:22.550] They don't have their teammates to [21:22.550 --> 21:23.970] bounce ideas off of [21:23.970 --> 21:26.270] and all they have is [21:26.270 --> 21:27.710] another fierce competitor sitting across from them [21:27.710 --> 21:29.590] and they don't know how far that person's made it yet. [21:29.590 --> 21:31.650] A big, big part [21:31.650 --> 21:33.550] of CTF is social and [21:33.550 --> 21:35.690] interaction and, you know, rubber [21:35.690 --> 21:37.490] ducking, bouncing ideas, working [21:37.490 --> 21:39.110] together on an exploit. Because [21:39.110 --> 21:41.690] we're, as commentators, we've really found [21:41.690 --> 21:43.830] out how easy it is to see bugs in someone else's [21:43.830 --> 21:45.630] code. And we know this, obviously, [21:45.630 --> 21:47.570] from, like, work, too. It's so [21:47.570 --> 21:49.410] much easier to see bugs in someone else's code [21:49.410 --> 21:51.550] when they're just sitting there writing it and, like, they're saying [21:51.550 --> 21:53.470] their logic out loud and then they write something totally [21:53.470 --> 21:55.910] different and you're like, that's not what that does. [21:56.130 --> 21:57.770] They're like, oh, damn, you're right. [21:57.770 --> 21:59.590] Yeah, it is always [21:59.590 --> 22:01.730] easier when you're, you know, one [22:01.730 --> 22:03.790] step removed. Yeah, even a, was [22:03.790 --> 22:05.710] it, even a 10x programmer, [22:05.710 --> 22:07.730] 10x hacker needs someone to [22:07.730 --> 22:10.050] work with sometimes. Oh, I totally agree. [22:10.110 --> 22:11.090] And I think that when [22:12.570 --> 22:13.750] with this tournament [22:13.750 --> 22:15.790] in particular, we've seen a little [22:15.790 --> 22:18.050] bit of teammate rotation. Yes. [22:18.050 --> 22:19.830] But a lot of these challenges [22:19.830 --> 22:21.770] have been Pwn challenges and a lot of them have been the [22:21.770 --> 22:23.990] same competitors for... Absolutely. [22:23.990 --> 22:25.650] most of the challenges. Yeah. [22:25.650 --> 22:27.610] Or we've had people switch [22:27.610 --> 22:29.770] off because they're just like, you know, [22:29.770 --> 22:31.490] I, this isn't really my forte. [22:31.850 --> 22:33.390] I'm not doing well [22:33.390 --> 22:35.450] solo. I don't really want to be under [22:35.450 --> 22:37.090] that pressure. Or they're like, [22:37.570 --> 22:39.530] you'd be better at this. Like, go for it. [22:39.530 --> 22:41.590] These teammates all have major [22:41.590 --> 22:43.550] confidence and trust in each other because [22:43.550 --> 22:45.670] you're working on these challenges. You're spending, you know, [22:45.670 --> 22:47.550] 16 hours looking at one challenge [22:47.550 --> 22:49.750] and then you have to be able to comfortably [22:49.750 --> 22:51.450] hand off your script to someone else so you can [22:51.450 --> 22:53.690] sleep. Yeah. And trust them [22:53.690 --> 22:55.570] to not like burn it all down [22:55.570 --> 22:57.510] or ruin it or like waste [22:57.510 --> 23:00.170] those precious hours in the competition. [23:01.290 --> 23:02.290] Exactly. [23:02.390 --> 23:03.810] And we've [23:03.810 --> 23:05.190] seen that really... [23:05.190 --> 23:07.950] I think the best example was the Python challenge yesterday. [23:07.950 --> 23:09.570] We saw some fresh faces [23:09.570 --> 23:11.610] and one of the competitors was [23:11.610 --> 23:13.630] not the person [23:13.630 --> 23:15.470] who had played previously for their team [23:15.470 --> 23:17.810] but then they executed an extremely fast [23:17.810 --> 23:19.730] solve. So clearly they had a specialist [23:19.730 --> 23:21.770] on that team. They knew, hey, this is [23:21.770 --> 23:23.950] going to be your challenge and it worked out for them. [23:24.190 --> 23:25.850] Absolutely. And I think really [23:25.850 --> 23:27.690] working with these people for so long and [23:27.690 --> 23:29.570] working in these high-stress, you know, [23:29.570 --> 23:31.550] fast-paced environments, really [23:31.550 --> 23:33.750] you build knowledge of who can do [23:33.750 --> 23:35.970] what the fastest and who can do what the most consistently. [23:35.970 --> 23:37.870] Those aren't always the same person. [23:38.550 --> 23:40.190] Exactly. Yeah. And [23:40.710 --> 23:42.090] I've heard this from a [23:42.090 --> 23:44.050] number of my friends in the community [23:44.050 --> 23:46.150] and talking to them about what makes [23:46.150 --> 23:48.070] their team good. And I think a [23:48.070 --> 23:49.790] big part of it is really understanding [23:49.790 --> 23:52.070] your teammates' [23:52.070 --> 23:53.830] strengths and knowing, I'm [23:53.830 --> 23:55.830] really struggling with this. I'm going to turn it [23:55.830 --> 23:57.670] over to this person or go to this person because [23:57.670 --> 23:59.730] I know that they're good [23:59.730 --> 24:01.510] at this sort of thing or maybe [24:01.510 --> 24:03.810] they just look at it differently. [24:03.810 --> 24:05.750] We're both good but we look at it differently. Looking at it [24:05.750 --> 24:07.830] differently is major also because it's so easy [24:07.830 --> 24:10.090] to get rabbit hole and just like... [24:10.090 --> 24:12.170] Oh yeah. Oh yeah. And that's [24:12.170 --> 24:13.810] key when you've got a teammate to say like, [24:13.810 --> 24:15.770] I don't think that this is the way to go. [24:15.770 --> 24:18.470] Yeah, this is nit guys. This is memcopy. [24:18.470 --> 24:20.550] And it is fun to see [24:20.550 --> 24:22.570] the different approaches that people have and I [24:22.570 --> 24:24.490] mean different in every sense of it. [24:24.490 --> 24:26.690] I know one good friend of mine, [24:27.310 --> 24:28.690] he is a very fast [24:28.690 --> 24:30.690] hacker but he has another [24:30.690 --> 24:32.490] teammate who is also very fast [24:32.490 --> 24:35.090] and I said, so which one of you is faster? [24:35.090 --> 24:36.410] And they looked at each other [24:36.410 --> 24:38.490] and they said, well, [24:38.490 --> 24:39.630] he types faster [24:40.390 --> 24:42.830] but I have to delete my stuff less [24:43.570 --> 24:44.630] and go back and [24:44.630 --> 24:46.590] fix less. So we're probably about [24:46.690 --> 24:47.650] a head and a head. [24:48.130 --> 24:50.590] I worked with two really good friends all throughout [24:50.590 --> 24:52.250] college and RPI sec on [24:52.250 --> 24:54.450] like crypto challenges and some reversing [24:54.450 --> 24:56.610] some web and we [24:56.610 --> 24:58.270] all have different strengths and I remember [24:58.270 --> 24:59.990] specifically when Defcon qualls, [25:00.410 --> 25:02.410] we split off from the rest of [25:02.410 --> 25:04.430] our team, went into [25:04.570 --> 25:06.430] a different room and just like closed [25:06.430 --> 25:08.450] door, like locked. We just had a big [25:08.450 --> 25:10.290] whiteboard and we're like, okay. [25:10.290 --> 25:12.530] And we all took a different part of this crypto problem [25:12.530 --> 25:14.410] and at the end just like put them all together [25:14.410 --> 25:15.930] and we got this all. Wow. [25:15.930 --> 25:18.250] It was we all know our own specific domain [25:18.250 --> 25:20.250] and work together to make one [25:20.250 --> 25:22.350] beautiful solution script. [25:22.450 --> 25:24.250] Yeah, that's great. I mean in the divide and [25:24.250 --> 25:26.250] conquer approach really works, especially [25:26.250 --> 25:28.310] when you've got some of these finals problems [25:28.310 --> 25:30.110] are massive, right? Or [25:30.110 --> 25:32.230] they'll be, you know, a common [25:32.230 --> 25:34.270] sort of thread, but okay [25:34.270 --> 25:36.330] so here's the same mini problem but solve [25:36.330 --> 25:38.310] it a thousand times, right? Could be one [25:38.310 --> 25:40.390] problem. And finals, attack, defend, you need [25:40.390 --> 25:42.370] to submit patches for it too that don't break [25:42.370 --> 25:44.430] SLA. Like you [25:44.430 --> 25:46.890] need to be able to keep the service up but fix. [25:46.890 --> 25:48.590] And one of the challenges, Torque [25:48.590 --> 25:50.350] also written by Glenn because it's cursed [25:52.210 --> 25:54.090] but is Torque and it's [25:54.590 --> 25:56.090] it's Torque. You can [25:56.090 --> 25:57.830] pop a shell in 2,000 different ways [25:58.370 --> 26:00.390] but one of those ways is [26:00.390 --> 26:00.770] you know [26:02.370 --> 26:04.450] it's how the game runs. So you can't [26:04.450 --> 26:06.410] really disable it. You need to make mitigation somewhere [26:06.410 --> 26:08.430] else. So just [26:08.430 --> 26:10.490] knowing specific domains and knowing how to work [26:10.490 --> 26:12.310] together is crazy. Here alone [26:12.310 --> 26:14.290] it looks like Hypeboy has been [26:14.290 --> 26:16.150] making good progress. They've been writing interaction [26:16.150 --> 26:17.470] wrappers. They're checking [26:18.930 --> 26:20.550] the offset from heap base. [26:20.550 --> 26:22.350] If I want to be really nice I could have had fixed base [26:22.350 --> 26:24.510] but I'm not that nice. [26:25.110 --> 26:26.230] Well they do, they can [26:26.230 --> 26:28.090] print out the addresses whenever they want, right? [26:28.090 --> 26:30.210] Yeah but then you need to write a parser and it's like who wants to [26:30.210 --> 26:31.010] parse? [26:33.050 --> 26:34.150] It's not like I give them [26:34.150 --> 26:36.070] really nice output that helped me [26:36.330 --> 26:37.910] a lot in solving this. [26:37.910 --> 26:39.630] Yep, those info leaks [26:39.630 --> 26:42.030] they come in handy especially when you're [26:42.030 --> 26:44.750] in a speed challenge like this. [26:44.970 --> 26:45.810] Oh yeah. [26:46.130 --> 26:48.090] And what I haven't noticed yet [26:48.090 --> 26:49.130] is anyone [26:50.610 --> 26:52.270] highlighting the real [26:52.270 --> 26:54.610] bug here? What function are we in? [26:54.750 --> 26:56.230] We're in malloc here? [26:56.230 --> 26:57.990] Oh! Wait, hang on. [26:57.990 --> 27:00.010] He's reading the line. Line 52 [27:00.010 --> 27:01.450] where the bug is. [27:01.630 --> 27:04.010] He's walking through it. If he does [27:04.690 --> 27:05.910] size minus delta [27:05.910 --> 27:07.770] he's just checking size. [27:08.210 --> 27:10.250] So I did this exact same thing. [27:10.250 --> 27:11.930] I looked at that exact thing and I was [27:11.930 --> 27:13.970] like, huh, I wonder why he did that. And then I forgot [27:13.970 --> 27:16.010] to comment it and it just went out of my [27:16.010 --> 27:17.990] head. I really want to see the comment, this is [27:17.990 --> 27:20.010] the bug. You're like, he's thinking about [27:20.010 --> 27:21.990] it. Oh. So the [27:21.990 --> 27:23.970] bug here being that you're checking the wrong [27:23.970 --> 27:25.910] size field is bigger than twice [27:25.910 --> 27:27.970] the size, or sorry [27:28.510 --> 27:29.910] the size of the free [27:29.910 --> 27:31.910] chunk is bigger than twice the size of [27:31.910 --> 27:33.830] the size field. But the size field being [27:33.830 --> 27:35.910] checked is the requested [27:35.910 --> 27:37.710] size. I love that comment. [27:37.710 --> 27:39.250] Is the requested size. [27:39.250 --> 27:41.570] Not the allocated size. So [27:41.570 --> 27:44.110] you get a chunk that has [27:44.110 --> 27:45.690] the size of the heap [27:45.690 --> 27:47.650] metadata overwrite into the next [27:47.650 --> 27:49.150] chunks info. [27:49.850 --> 27:52.230] Which, you know, it's the entire thing. [27:52.230 --> 27:53.850] So you have arbitrary [27:53.850 --> 27:55.630] you can allocate [27:55.630 --> 27:57.710] basically a fake [27:57.710 --> 27:59.590] chunk. And then you get [27:59.590 --> 28:01.950] arbrite. Using the [28:01.950 --> 28:03.850] next pointer? Yeah, using next [28:03.850 --> 28:05.790] pointer. And it's what's [28:05.790 --> 28:07.930] going to be really important is the second part of this challenge [28:07.930 --> 28:08.910] which is finding [28:09.810 --> 28:11.530] an offset that they write to [28:11.530 --> 28:13.410] that doesn't cause a next pointer [28:13.850 --> 28:16.130] to be an invalid deref in crash. [28:16.130 --> 28:17.730] Ah, right. Yeah. So that's [28:17.730 --> 28:19.630] the second part of this challenge. There's a couple of pieces here. [28:19.630 --> 28:21.250] There are a couple of pieces, but Straw Hat [28:21.850 --> 28:23.650] finding the line with the bug is [28:23.650 --> 28:25.750] big. And they did go right [28:25.750 --> 28:27.730] into writing their script [28:27.730 --> 28:29.670] which, that's a good sign. Now, [28:29.670 --> 28:31.670] over on Hypoi, it looks [28:31.670 --> 28:33.590] like they're [28:33.590 --> 28:35.590] walking through the [28:35.590 --> 28:37.650] removal code. I really [28:37.650 --> 28:39.570] hope they've looked at malloc and everything. I think they [28:39.570 --> 28:41.690] have. We did see them exploring [28:42.370 --> 28:43.950] looking at the implementation. [28:43.950 --> 28:45.530] I don't think we saw them. So they know [28:45.530 --> 28:47.770] it's not standard. Right. [28:47.870 --> 28:49.590] And the category of this challenge we gave [28:49.590 --> 28:51.430] them was custom heap allocator. [28:51.690 --> 28:53.670] They came in knowing. They really [28:54.210 --> 28:55.530] should know. We made sure [28:55.530 --> 28:57.550] that they weren't going to just scan [28:57.550 --> 28:58.450] over it. [28:59.370 --> 29:01.510] But I really want to see. I think right now [29:01.510 --> 29:03.750] they're looking for double freeze. [29:03.810 --> 29:05.410] But they're noticing... [29:05.410 --> 29:07.370] No, they're not looking for double freeze because they're in add room [29:07.370 --> 29:09.530] remove room. So I think what they're trying to [29:09.530 --> 29:11.490] do is make room size [29:11.490 --> 29:13.410] mismatch. Which [29:13.410 --> 29:15.590] is close. [29:15.750 --> 29:17.630] Well, I'll say that if the category [29:17.630 --> 29:19.550] is custom heap allocator, that's [29:19.550 --> 29:21.550] still, you know, a number [29:21.550 --> 29:22.970] of bugs could be [29:23.530 --> 29:25.550] under that category, right? Yeah. [29:25.550 --> 29:27.390] When I was developing this, I was debating, like, [29:27.390 --> 29:29.670] oh, do we forget to set free in, like, a [29:29.670 --> 29:31.550] chunk split? Or [29:32.130 --> 29:33.710] do we forget to, like, update [29:33.710 --> 29:35.790] the data point or the [29:35.790 --> 29:38.350] next pointer and it points into your data? [29:38.350 --> 29:39.710] And it could be so many [29:39.710 --> 29:41.610] different things. [29:41.610 --> 29:43.550] But I think... [29:44.110 --> 29:45.290] Yeah, Hypo [29:45.290 --> 29:47.670] is going to be going through and [29:47.670 --> 29:49.750] trying to figure out, you know, a standard heap bug. [29:49.750 --> 29:51.530] Is it UAF? Is it a known house of [29:51.530 --> 29:52.510] besides House of Barbie? [29:52.510 --> 29:54.150] Yep. I mean, my [29:55.090 --> 29:56.610] immediate thought looking at [29:56.610 --> 29:58.510] this was, okay, are we looking at double [29:58.510 --> 30:00.490] free? Is this heap [30:00.490 --> 30:02.550] buffer overflow and some friendly metadata [30:02.550 --> 30:04.550] that can be smashed? Yeah. [30:04.550 --> 30:06.650] Is it some UAF? Exactly. [30:07.210 --> 30:08.470] You know, can I... [30:08.470 --> 30:10.630] There was a challenge I always wanted to write that I'm going to [30:10.630 --> 30:13.030] leak now. But is it, like, a [30:13.030 --> 30:14.830] heap meets stack kind of [30:14.830 --> 30:16.850] thing where you get... The classic [30:16.850 --> 30:19.050] love story. Yeah. [30:19.050 --> 30:20.430] Very boy meets world. [30:20.430 --> 30:22.650] The stack Topanga and the heap Cory Matthews. [30:22.650 --> 30:24.630] Oh my gosh. I remember those names. [30:24.630 --> 30:26.490] That's crazy. How could you forget [30:26.630 --> 30:27.690] a name like Topanga? [30:28.270 --> 30:30.090] Match made in heaven. But [30:30.850 --> 30:32.550] we saw Straw Hat [30:32.550 --> 30:34.590] just then revisiting the line, trying to figure [30:34.590 --> 30:36.570] out... It looks like trying to [30:36.570 --> 30:38.430] figure out what they can do with it, trying to figure out the right [30:38.430 --> 30:40.230] structs to use. If memory [30:40.230 --> 30:42.390] serves, which sometimes [30:42.390 --> 30:44.970] it doesn't, but in this challenge it does, [30:46.250 --> 30:47.790] you can grow [30:47.790 --> 30:49.730] the list of furniture [30:49.730 --> 30:50.590] in the room [30:52.130 --> 30:53.630] to be, you know, [30:53.630 --> 30:55.650] 32 bytes. And then the size [30:55.650 --> 30:57.850] of the furniture struct [30:57.850 --> 30:59.650] itself, 16 bytes. [31:01.010 --> 31:01.690] So, [31:01.690 --> 31:03.790] you get... What is it? The size of [31:03.790 --> 31:05.030] the header is [31:05.780 --> 31:06.070] 24 [31:07.710 --> 31:09.710] bytes plus 16 bytes. [31:09.710 --> 31:11.770] You get 16 byte overwrite into the [31:11.770 --> 31:13.690] next chunk. Okay, so we [31:13.690 --> 31:15.860] see that the first hint has dropped. Oh, the [31:15.860 --> 31:17.720] first hint dropped. Do all chunks have the [31:17.720 --> 31:18.940] correct size? [31:20.600 --> 31:21.780] Which is definitely going to be a helpful [31:21.780 --> 31:23.540] hint because at least the [31:23.540 --> 31:25.480] size field was called out in the [31:25.480 --> 31:27.660] printing, the debug printing function. So that's [31:27.660 --> 31:29.760] helpful. Absolutely. [31:29.760 --> 31:31.600] And I think that it will be [31:31.600 --> 31:33.580] most helpful for Hypeboy because [31:33.580 --> 31:35.920] Straw Hat, we think we've seen... [31:35.920 --> 31:37.700] They probably know that. They [31:37.700 --> 31:39.660] probably know. So this is going to [31:39.660 --> 31:41.720] push Hypeboy to catch up. Yep. [31:41.720 --> 31:43.600] So now they're looking in Realloc. [31:43.600 --> 31:44.880] They're walking through. [31:45.420 --> 31:47.960] One step off here. A minus 24. [31:47.960 --> 31:49.180] So the size of the [31:50.020 --> 31:51.520] chunk metadata is [31:51.520 --> 31:52.540] 24. [31:53.620 --> 31:55.720] They're going to be walking through and checking. [31:56.420 --> 31:57.400] Now, Realloc [31:57.900 --> 31:59.580] doesn't do the actual allocation [31:59.580 --> 32:01.600] itself. It calls out to malloc. So that should say to [32:01.600 --> 32:03.420] them, oh, the only [32:03.420 --> 32:05.420] place where the size is properly set [32:05.420 --> 32:07.720] is malloc. So I need to check the branches [32:07.720 --> 32:08.500] there. [32:11.730 --> 32:13.190] So they're going to be going [32:13.190 --> 32:15.290] through, stepping through, [32:15.290 --> 32:17.110] making sure that everything is the correct [32:17.110 --> 32:18.570] size. I'm [32:19.750 --> 32:21.210] a little bit worried that because they [32:21.210 --> 32:23.370] haven't gone too in-depth in the heap implementation, [32:23.770 --> 32:24.810] that they're going to be thinking [32:25.350 --> 32:27.370] that I'm, like, [32:27.370 --> 32:29.070] under-allocating for a struct, just [32:29.070 --> 32:30.390] automatically, which [32:30.910 --> 32:32.310] I'm not that nice. [32:33.050 --> 32:35.230] Well, I mean, especially when you're [32:35.230 --> 32:36.930] reversing, the size of the struct [32:36.930 --> 32:39.570] that's being allocated is usually a [32:39.570 --> 32:41.210] very strong hint because, you know, who's going to [32:41.210 --> 32:42.910] mess that up? But with the CTF [32:42.910 --> 32:45.130] challenge, you never know. True. [32:45.130 --> 32:46.990] But they should also be able to see. [32:46.990 --> 32:49.150] They have all the info printed out to them. They should do struct [32:49.150 --> 32:51.150] recovery, know the size of it, and just be able to [32:51.150 --> 32:53.290] immediately knock out, oh, this is 16, this is 32, [32:53.290 --> 32:54.950] this is also 16, [32:54.950 --> 32:57.190] and just say, oh, these are all correct. Mark them as correct [32:57.190 --> 32:58.450] and move on. Yeah. [32:58.450 --> 33:01.210] I know on one side I saw [33:01.590 --> 33:02.310] the player [33:03.170 --> 33:05.190] annotating structs, making sure that they had that [33:05.190 --> 33:06.550] in their decompilation. [33:06.550 --> 33:06.950] Yeah. [33:09.130 --> 33:10.530] I don't know if I saw that on the [33:10.530 --> 33:12.490] Hypebites side, but I might have just missed it. [33:12.630 --> 33:14.570] Not 100%. It looks like [33:14.570 --> 33:16.350] they're calculating offsets [33:16.350 --> 33:18.530] correctly. So, one other [33:18.530 --> 33:20.530] big hint here is if you get [33:21.230 --> 33:22.470] data minus address [33:22.470 --> 33:24.490] not equal to size, you know [33:24.490 --> 33:26.730] that chunk is wrong. That chunk has the wrong size. [33:26.730 --> 33:28.290] Right. Because the data of a chunk [33:28.290 --> 33:30.130] is just immediately after metadata. [33:30.850 --> 33:32.730] And they should see that. [33:33.210 --> 33:34.550] Well, so that's a little bit [33:34.550 --> 33:36.290] of a second order analysis here, which [33:36.290 --> 33:38.530] may not be immediately apparent. [33:39.350 --> 33:40.490] I mean, if you break in [33:40.570 --> 33:42.510] a debugger, if you change, the first step [33:42.510 --> 33:44.490] of this challenge is setting the name for the house. [33:44.630 --> 33:46.490] Or you can set the name for the house and get [33:46.610 --> 33:48.270] a simple allocation. If you [33:48.930 --> 33:50.390] set a debug breakpoint, [33:50.390 --> 33:52.330] print the address of the name of the house, [33:52.330 --> 33:54.470] and then print the address of the chunk, you should see [33:54.470 --> 33:56.190] oh, this is just immediately after. [33:56.870 --> 33:58.550] You know, it's a little [33:58.550 --> 34:00.630] thing that's taken for granted in [34:00.630 --> 34:02.330] standard lib heap. [34:03.030 --> 34:04.370] But you really need [34:04.370 --> 34:05.670] to get a good sense of [34:06.530 --> 34:07.990] what this does. [34:08.430 --> 34:10.330] Yeah, well, this is... [34:10.910 --> 34:12.730] I'm trying to think of the number of [34:13.390 --> 34:14.470] custom heap allocator [34:14.470 --> 34:16.390] challenges I've seen. I mean, this may be [34:16.390 --> 34:18.450] just kind of [34:18.570 --> 34:20.530] a weird thing to think about. And it's not necessarily [34:20.530 --> 34:22.270] easy. True. [34:22.270 --> 34:24.150] There have been... I was talking with Lightning [34:24.150 --> 34:26.430] and she did like a protected [34:27.450 --> 34:28.330] malloc, [34:28.330 --> 34:30.150] which was a custom [34:30.150 --> 34:32.410] heap allocator. It was almost a complete rewrite. [34:32.610 --> 34:33.810] But it was rewritten to use [34:34.570 --> 34:36.810] MD5 verification of chunk metadata. [34:37.130 --> 34:38.350] So definitely optimized [34:38.350 --> 34:40.530] for performance. Oh, yeah, totally. [34:40.530 --> 34:41.990] MD5 is the fastest. [34:42.810 --> 34:44.150] Oh, my gosh. [34:44.370 --> 34:46.510] Yeah, so I'm hoping the teams... [34:46.510 --> 34:48.410] Obviously, I'm hoping the teams solve this. [34:48.410 --> 34:50.370] It looks like over on [34:50.370 --> 34:52.490] Straw Hat, they're making [34:52.490 --> 34:54.510] consistent progress. They're trying to figure out [34:54.950 --> 34:56.330] can I overallocate? [34:56.330 --> 34:58.350] I'm making the size of the room. They're making the [34:58.350 --> 34:59.170] size of the room [35:00.090 --> 35:01.990] large enough here. It's important that [35:02.850 --> 35:04.370] each room has a size. [35:04.370 --> 35:06.450] Each furniture item has a size. And you can't [35:06.910 --> 35:08.230] put, you know, [35:08.910 --> 35:10.250] obviously too large furniture [35:10.250 --> 35:12.230] in a room. That doesn't make it a dream house. That makes [35:12.230 --> 35:14.010] it a nightmare house to get through the door. [35:14.290 --> 35:16.130] So, you know, [35:16.130 --> 35:18.390] let's just make them good sizes. It might also [35:18.390 --> 35:20.270] be, you know, a very convenient feel to [35:20.270 --> 35:22.270] have an arbitrary unsigned [35:22.270 --> 35:24.470] 64-bit integer in there. You know, [35:24.470 --> 35:26.230] that would be nice. Right, right. [35:26.230 --> 35:28.230] Yeah, I was thinking that one of the [35:28.230 --> 35:30.230] things that I'm thinking about looking [35:30.230 --> 35:32.250] at a heap challenge is what are the [35:32.250 --> 35:34.270] resizable things that I control? [35:34.270 --> 35:35.790] Or what arbitrary [35:35.790 --> 35:37.890] data can I stuff into it? So [35:37.890 --> 35:40.230] with, say, the names, [35:40.230 --> 35:42.170] for example, okay, so now I've [35:42.170 --> 35:43.750] got potentially a resizable [35:44.390 --> 35:45.470] amount of memory [35:46.210 --> 35:48.210] depending on how name allocation [35:48.210 --> 35:49.210] is handled. [35:49.910 --> 35:52.070] But as you said, if it can take [35:52.070 --> 35:54.690] an arbitrary unsigned integer as the size, [35:54.690 --> 35:56.050] well, now I'm thinking [35:56.590 --> 35:58.750] how is that going to be used for exploitation? [35:58.790 --> 36:00.550] Yeah, like, oh, I can write a pointer [36:00.550 --> 36:02.030] here. Where do I want to write it? [36:02.990 --> 36:04.810] And it's walking through [36:04.810 --> 36:06.570] that. So it looks like Straw Hat is [36:06.570 --> 36:08.650] writing just kind of a simple interaction [36:08.650 --> 36:10.570] wrapper. They only have add room [36:10.570 --> 36:12.630] and rename right now. Yeah, so they're working back [36:12.630 --> 36:14.710] from the bug, right? They're only writing [36:15.450 --> 36:16.250] the menu [36:16.730 --> 36:18.670] interaction that they think that they need [36:18.670 --> 36:20.610] not trying to have a wrapper function [36:20.610 --> 36:22.590] for everything in the menu. Yeah, and it [36:22.590 --> 36:24.610] might be possible to solve this with only rooms. [36:24.610 --> 36:26.870] My solution used rooms and furniture, [36:26.870 --> 36:28.570] but you could do it with [36:28.570 --> 36:30.470] only rooms, I'm sure. I mean, I think the structs [36:30.470 --> 36:32.630] are the same size. Well, the way you talk about [36:32.630 --> 36:34.610] dream houses, Josh, doesn't surprise me. [36:34.610 --> 36:36.470] How could you have a dream house with no [36:36.470 --> 36:38.590] furniture? It's so true. Well, I [36:38.590 --> 36:40.390] feel like it just makes the feng shui easier. [36:40.790 --> 36:42.550] You know, the flow of energy isn't interrupted by [36:42.550 --> 36:43.810] anything or redirected. [36:44.590 --> 36:46.550] Josh, that's the best heap feng shui joke I've [36:46.550 --> 36:48.150] heard all day. Thank you so much. [36:50.710 --> 36:52.070] Wait, all day? [36:52.070 --> 36:53.630] That was the first one. [36:57.170 --> 36:57.890] All right. [36:57.890 --> 37:00.070] So it looks like over on a high point, [37:01.090 --> 37:01.530] they're... [37:01.530 --> 37:03.810] Oh, so they have a room. They're adding furniture [37:03.810 --> 37:06.030] to a room. They're allocating it. [37:06.030 --> 37:07.810] You can over-allocate this. That's fine. Adding [37:07.810 --> 37:08.590] 50. [37:10.870 --> 37:11.310] And... [37:11.310 --> 37:13.770] Looks like they have an item with no [37:13.770 --> 37:15.890] name. That's because you used up [37:15.890 --> 37:16.710] the horse. [37:18.370 --> 37:19.630] I saw a hex stump [37:19.630 --> 37:21.870] coming out. Oh, there's a hex stump. [37:21.870 --> 37:23.110] There's a seg fault. [37:23.690 --> 37:25.830] Okay, that's a good sign. That's a [37:25.830 --> 37:27.850] great sign. So they just sped [37:27.850 --> 37:31.390] ahead here. And it looks like [37:31.390 --> 37:32.750] that their [37:32.750 --> 37:34.590] reallocation... They're going to find out [37:34.590 --> 37:36.590] very soon that reallocation is very busted. [37:36.590 --> 37:38.190] If they don't find out very soon, hint two [37:38.190 --> 37:41.290] will let them know because I think it's exactly that. [37:41.290 --> 37:42.510] Or no, I made it very [37:42.510 --> 37:45.090] clear that it's not in reallocation. [37:45.090 --> 37:45.250] It's in splitting. Yes, [37:45.250 --> 37:47.290] an earlier iteration of the [37:47.290 --> 37:49.650] hints led me astray. [37:50.710 --> 37:51.430] It was... [37:51.930 --> 37:53.230] Yeah, no, I can't [37:53.230 --> 37:55.190] defend it. It was. [37:57.430 --> 37:59.230] Some other sort of excitement going on [37:59.230 --> 38:01.230] in the room right now. It's hard to [38:01.230 --> 38:03.190] tell how much is making it through the microphones, but [38:03.190 --> 38:05.110] there is a lot of action in this big room. [38:05.110 --> 38:06.890] Yeah, there is a lot. Sounds like another competition [38:06.890 --> 38:08.970] just ended, had the countdown. [38:10.170 --> 38:11.150] I'm not sure which [38:11.150 --> 38:13.170] it was. I think it was Hackasad, actually, so we might [38:13.170 --> 38:14.950] be getting our Jordan back soon. [38:15.570 --> 38:17.030] Excellent. Well, the Hackasad, [38:17.030 --> 38:19.210] very cool competition for all of our [38:19.210 --> 38:21.290] viewers. If you haven't heard of it, [38:21.290 --> 38:23.250] very cool stuff. And, you [38:23.250 --> 38:24.330] know, they've got Jordan, so [38:24.990 --> 38:27.210] obviously they've got a pretty good commentator. Their production [38:27.210 --> 38:29.010] values through the roof. Oh, yeah. [38:29.010 --> 38:31.010] Really cool stuff. So it looks like [38:31.010 --> 38:32.930] over on Hypeboy, [38:32.930 --> 38:35.310] they're getting invalid furniture items. [38:35.310 --> 38:36.830] They're getting reallocation bugs [38:36.830 --> 38:39.090] because you're going back, your [38:39.090 --> 38:41.350] furniture list is increasing, [38:41.350 --> 38:43.270] increasing, increasing. Oh, and now they're fine [38:43.270 --> 38:45.310] tuning their offsets to get that. Nice. [38:45.310 --> 38:47.410] It's increasing so much, they have a leak [38:47.410 --> 38:49.610] in the size field now, and they see it here. [38:49.610 --> 38:51.190] So they know that the size [38:51.190 --> 38:53.270] field overlaps. The size [38:53.270 --> 38:54.970] field overlaps the next heap metadata [38:54.970 --> 38:56.930] size field, or next heap metadata [38:58.270 --> 38:59.450] next pointer. [38:59.450 --> 39:00.610] That's what I meant to say. [39:01.490 --> 39:03.130] It's so clear. And knowing [39:03.130 --> 39:05.490] that, creating new furniture, [39:06.070 --> 39:07.190] they know that they're [39:07.190 --> 39:08.670] going to be able to write [39:08.670 --> 39:11.250] to that next pointer. [39:11.390 --> 39:12.870] And if you write to a next pointer, [39:12.870 --> 39:14.810] point that up, writeable memory, [39:14.810 --> 39:16.470] and then allocate something else, [39:16.470 --> 39:18.770] you can get potentially an ARB write. [39:19.730 --> 39:20.610] Yeah, I think they're [39:20.610 --> 39:21.910] making great progress. [39:22.930 --> 39:23.950] Oh, yeah. [39:25.190 --> 39:26.590] I was trying to look and see [39:26.590 --> 39:28.730] in their chunk list there, [39:28.730 --> 39:30.390] in the debug prints, [39:30.390 --> 39:32.590] if we saw any pointers, it started to look like [39:32.590 --> 39:34.530] they had control. The problem is, [39:34.530 --> 39:36.530] they are over-allocating right now. [39:36.530 --> 39:38.330] So the debug print is going to print [39:38.330 --> 39:40.470] so many chunks that it's going [39:40.470 --> 39:42.230] to be hard to scroll through and find them. [39:42.970 --> 39:44.510] So I think you only need to [39:44.510 --> 39:46.250] add something like five, [39:46.250 --> 39:48.390] six furniture items max. [39:48.670 --> 39:50.530] And that's going to be a much more manageable [39:50.530 --> 39:52.310] like 20 chunks. I saw them printing out like [39:52.310 --> 39:53.190] 54. [39:54.090 --> 39:56.210] I think that this is the kind of problem. [39:56.210 --> 39:58.170] I'm a very visual guy, and [39:58.170 --> 40:00.150] for me, seeing a long list of [40:00.150 --> 40:02.370] tabular data, it's hard [40:02.370 --> 40:04.110] to visualize. And when I'm [40:04.110 --> 40:06.090] working on a challenge like this, I'm making [40:06.250 --> 40:08.330] a picture in my head. And if I can't make that picture, [40:08.330 --> 40:10.250] just due to the raw size of the data [40:10.250 --> 40:12.270] or the complexity of what I'm dealing with, [40:12.270 --> 40:14.090] it's hard. Yeah, absolutely. [40:14.090 --> 40:16.170] Honestly, it would have been really cute to write [40:16.370 --> 40:18.350] a visualization like... [40:18.350 --> 40:19.890] A Barbie house visualization? [40:19.890 --> 40:22.030] Yeah, where you can see, or like for the heap [40:22.030 --> 40:23.910] chunks just overlaps and stuff. [40:23.990 --> 40:25.190] What a missed opportunity. [40:26.050 --> 40:28.230] That code would have had so many bugs in it. [40:28.290 --> 40:30.190] Like, that sounds hard. [40:30.190 --> 40:32.130] Okay, and if we switch over to the [40:32.130 --> 40:33.970] raw hat side, we can see that they are [40:35.110 --> 40:36.070] examining their [40:36.070 --> 40:37.570] chunk list. [40:38.730 --> 40:40.290] They've got some large [40:40.290 --> 40:41.890] allocations going on. [40:42.190 --> 40:44.090] So that chunk size 2f is going to [40:44.090 --> 40:45.410] come up in the future. [40:46.770 --> 40:47.450] Yeah. [40:48.070 --> 40:50.230] That's actually pretty important. [40:50.230 --> 40:51.790] So what's... [40:51.790 --> 40:53.850] I don't want to give the solution away here. [40:54.690 --> 40:55.870] We'll see. [40:56.590 --> 40:58.650] How far are we to hint2, production? [41:03.080 --> 41:04.720] We're checking in now. [41:05.060 --> 41:06.180] Hint2 just came up. [41:06.180 --> 41:08.020] And hint2 just dropped. So the competitors, [41:08.020 --> 41:10.240] they have a timer that they can revisit. [41:10.500 --> 41:12.280] They may not be looking at... [41:12.280 --> 41:14.160] I'm guessing they're not looking at the clock. [41:14.220 --> 41:14.980] No, I don't think so. [41:16.300 --> 41:18.160] We will probably see one of them [41:18.160 --> 41:20.160] flip over and check to see if the hint [41:20.160 --> 41:22.140] has dropped here. But they're both kind of on a roll [41:22.140 --> 41:23.940] too, just judging by how [41:23.940 --> 41:25.220] quickly they're typing. [41:26.240 --> 41:28.520] It's definitely something that's not on the top of your mind. [41:28.520 --> 41:30.540] Hey, what's the next hint? Unless you're stuck. [41:30.540 --> 41:32.160] Yeah, I kind of want to [41:32.160 --> 41:34.900] have production go tell them hint2 dropped. [41:34.900 --> 41:36.120] But at the same time, I don't want to [41:36.120 --> 41:38.700] ruin their train of thought. I think we don't interrupt [41:38.700 --> 41:40.600] them. We told them when the hint was going to be at the beginning. [41:40.600 --> 41:42.320] No, and I think that that's... [41:43.520 --> 41:44.520] that's the way we've been [41:44.520 --> 41:46.920] running this competition. And as you said, [41:46.920 --> 41:48.140] both of these competitors [41:48.580 --> 41:50.800] seem to be on a roll, typing really fast. [41:50.800 --> 41:53.580] It's not like they just have a [41:53.580 --> 41:54.570] cursor hanging over [41:55.380 --> 41:58.140] idly, hovering things in IDA. [41:58.140 --> 41:58.460] They are moving [41:58.460 --> 41:59.720] towards the solution. [42:00.120 --> 42:02.000] Oh, got EOF. [42:02.320 --> 42:04.320] So it looks like they have [42:05.120 --> 42:06.000] next. [42:08.640 --> 42:10.020] So let's flip over to [42:10.020 --> 42:11.500] HypeBoy and take a look. [42:11.500 --> 42:12.720] Oh, thank you. Sorry. [42:15.420 --> 42:16.400] Next is null. [42:16.400 --> 42:17.520] Sending 50. [42:17.960 --> 42:20.100] Yeah, so it looks like they're getting... [42:20.100 --> 42:22.480] Oh, you just need to print the state of the crash here. [42:22.860 --> 42:23.960] You're so close. [42:26.400 --> 42:28.100] So once they get [42:28.100 --> 42:29.520] control on [42:30.080 --> 42:32.080] this, they overwrite a pointer. [42:32.080 --> 42:34.020] What's the next step? So you overwrite [42:34.020 --> 42:36.320] the next pointer. Where are you going to point it to? [42:36.900 --> 42:38.040] Right before the [42:38.040 --> 42:39.520] got is pretty nice. [42:39.840 --> 42:41.860] Because, you know, I think this is no [42:41.860 --> 42:42.700] rel row. [42:43.600 --> 42:45.980] You can push that right before the got. [42:46.360 --> 42:48.360] Right before the got, [42:48.360 --> 42:50.020] you know, if they look around there, you might [42:50.020 --> 42:52.140] notice, oh, there's a very convenient field [42:52.140 --> 42:54.120] of zeros with, you know, some other bytes [42:54.120 --> 42:55.540] in there. So [42:55.540 --> 42:57.440] you could point it right before. [42:58.820 --> 42:59.680] Let's see. Right before [42:59.680 --> 43:01.560] the got is going to be... [43:01.560 --> 43:03.360] Oh, I forget where it is in no rel row. [43:03.540 --> 43:05.440] It's been a minute. So what's the [43:05.860 --> 43:07.380] characteristics that we're looking at here? [43:07.380 --> 43:09.480] It's readable and writable? You're looking for something [43:09.480 --> 43:10.400] that'll have [43:11.700 --> 43:13.320] a big enough size, a size [43:13.320 --> 43:15.340] that you can put, you know, ideally [43:15.340 --> 43:17.400] the house name into. Because [43:17.400 --> 43:19.860] that's the easiest thing to control. [43:19.880 --> 43:21.420] You're looking for something that has a size [43:21.420 --> 43:23.540] field that matches that. You're looking [43:23.540 --> 43:25.320] for something that has free set. [43:25.360 --> 43:27.580] That's the most important thing, is you need [43:27.580 --> 43:29.620] to have the free field set in order for that chunk to be used [43:29.620 --> 43:31.340] by any new allocation. [43:31.540 --> 43:33.600] And then you want the next pointer [43:33.600 --> 43:35.440] to be either valid [43:35.440 --> 43:37.420] or not. [43:37.620 --> 43:39.680] And so in this case, what you're doing [43:39.680 --> 43:41.620] is you're setting up a portion [43:41.620 --> 43:43.920] of memory to look like a chunk [43:43.920 --> 43:45.860] so that you can use it. [43:46.260 --> 43:47.540] You're making a fake [43:47.540 --> 43:49.600] heap chunk in, like, program [43:49.600 --> 43:51.320] memory, in the BSS. Exactly. [43:51.320 --> 43:52.640] So fake heap chunk. [43:53.980 --> 43:55.320] And then from there, we're... [43:57.440 --> 43:59.200] I see some very [43:59.200 --> 44:01.440] active mouse work over here. [44:01.440 --> 44:03.260] I want to jump over to HypeBoy [44:03.260 --> 44:05.180] and see what they're looking at. [44:05.500 --> 44:06.420] There we go. [44:07.720 --> 44:09.300] Doing the math in their head, you could [44:09.300 --> 44:10.500] see it work out. [44:11.200 --> 44:13.360] Okay, so I see Straw Hat [44:13.360 --> 44:15.240] has picked up hint [44:15.240 --> 44:17.440] two. I didn't know hitting enter after [44:17.440 --> 44:19.740] an examine command would just, like, step forward. [44:19.740 --> 44:21.680] That's pretty nice. I didn't know that. I just always [44:21.680 --> 44:23.860] change the offset. Yeah, well, [44:23.860 --> 44:25.200] I mean, that's one of the things. I think [44:26.000 --> 44:26.720] if you [44:27.940 --> 44:29.860] are a competitor at this level, [44:30.380 --> 44:31.680] if you're not taking a look at [44:31.680 --> 44:33.720] some of the tricks that your competitors are doing, because this is [44:33.720 --> 44:36.500] all live, right? Everybody's [44:37.040 --> 44:37.800] aware that what [44:37.800 --> 44:40.120] they're going to do is going to be public, [44:40.120 --> 44:41.900] at least in that the stream is visible. [44:41.900 --> 44:43.620] So there's a lot of interesting [44:43.620 --> 44:45.500] techniques to be cleaned. Absolutely. [44:45.660 --> 44:47.680] And over on Straw Hat, we see them looking [44:47.680 --> 44:50.140] in the buggy check. [44:50.460 --> 44:52.340] Were they just looking at Malik? [44:53.720 --> 44:56.400] Or they're looking at where Malik is used. [44:58.300 --> 44:59.760] Weren't they? Oh, no, they weren't [44:59.760 --> 45:01.480] at furniture. I'm sorry. It just looked [45:01.480 --> 45:03.640] very similar. There was a size [45:03.640 --> 45:05.920] check greater than, but it said V2. [45:06.340 --> 45:07.740] And so we don't think that we've seen [45:07.740 --> 45:08.920] them have control [45:10.140 --> 45:11.620] yet. I don't believe [45:11.620 --> 45:13.240] they've gotten a crash yet. [45:13.860 --> 45:15.640] I'm not 100% on that, [45:15.640 --> 45:15.700] but [45:17.320 --> 45:19.620] I don't know. We'll keep an eye on them [45:19.620 --> 45:21.640] for sure. It looks [45:21.640 --> 45:23.560] like over on Hype Boy, they're [45:23.560 --> 45:24.600] going into [45:25.600 --> 45:27.920] remove furniture and figuring out what it does. [45:27.920 --> 45:28.400] It actually [45:29.680 --> 45:31.620] well, you know, we'll see here. It frees [45:31.620 --> 45:33.600] the name, it frees the struct, and [45:33.600 --> 45:35.960] it decreases the size of [45:36.920 --> 45:37.400] the [45:37.960 --> 45:38.780] furniture item [45:39.460 --> 45:41.620] linked list size count field, [45:41.620 --> 45:43.480] whatever that is. It's not really [45:43.480 --> 45:45.400] important. It's just like a linked list [45:45.400 --> 45:46.480] implementation. [45:48.920 --> 45:49.560] Yeah, so [45:49.560 --> 45:51.240] part of this is really just [45:52.420 --> 45:53.480] understanding exactly what [45:53.480 --> 45:55.060] you're supposed to do with the bug. [45:55.720 --> 45:56.160] Which [45:57.700 --> 45:59.380] as we've said a couple times [45:59.380 --> 46:01.200] now, a lot of different ways to go with [46:01.200 --> 46:03.480] heap. I think that they're [46:05.260 --> 46:05.700] packing [46:05.920 --> 46:07.340] a pointer, so they're just [46:07.340 --> 46:08.340] understanding. [46:09.800 --> 46:11.580] So if I'm mistaken, [46:11.580 --> 46:13.460] have they annotated that struct, or [46:13.460 --> 46:15.940] are they just looking at offsets? No, I was just thinking that. [46:15.940 --> 46:17.380] I would really annotate that [46:17.380 --> 46:19.580] struct. That would make stuff stand out [46:19.860 --> 46:21.620] a lot clearer. [46:22.080 --> 46:23.580] Well, with more than one struct, it's [46:23.580 --> 46:25.580] definitely something, like if it was only one [46:25.580 --> 46:27.740] struct, sure, maybe you can just think about the offsets, [46:27.740 --> 46:29.620] but with more than one in play, [46:29.620 --> 46:31.640] definitely that would help. Unless [46:31.640 --> 46:33.780] do they... [46:34.720 --> 46:35.720] are they going to return [46:35.720 --> 46:36.720] to it properly? [46:39.880 --> 46:41.540] Oh, come on, you need to [46:41.540 --> 46:44.100] print out the state, looking at debugger. [46:44.300 --> 46:46.020] Oh, there we go, up there. [46:47.720 --> 46:49.560] On the straw hat side, I just saw them [46:49.560 --> 46:50.880] double-clicking. They're [46:51.540 --> 46:52.700] looking at the [46:53.820 --> 46:55.660] debug heap prints, [46:55.660 --> 46:57.460] and I saw them double-clicking on the [46:57.460 --> 46:59.460] size2f. I think [46:59.460 --> 47:01.540] that they're... [47:02.140 --> 47:03.460] Okay, now that might be [47:03.460 --> 47:05.660] just standing out because that's like slash. [47:06.600 --> 47:07.480] And it might just [47:08.760 --> 47:09.220] be... [47:09.220 --> 47:11.060] Well, let's see here. [47:11.360 --> 47:13.300] Yeah, I'm curious if they're [47:13.300 --> 47:15.320] still sort of feeling around. Maybe they [47:15.320 --> 47:17.400] know something is wrong, but they can't [47:17.400 --> 47:19.120] quite isolate it. [47:19.280 --> 47:21.460] I'm not sure. Not 100%, [47:21.460 --> 47:22.980] they have more of a wrapper now. [47:23.400 --> 47:25.040] Yeah, they're getting their [47:25.040 --> 47:27.100] interaction sorted out here. [47:27.840 --> 47:28.760] And over on [47:29.480 --> 47:31.260] Hypo, we saw them double-clicking some addresses [47:31.260 --> 47:32.140] too. [47:32.880 --> 47:34.880] Figuring out what the offset is. [47:39.040 --> 47:40.120] Oh, they have... [47:40.120 --> 47:42.800] Yeah, they have a wrong size field. Size is 0x980. [47:42.800 --> 47:44.380] That's super wrong. [47:45.140 --> 47:46.220] So I think they [47:46.220 --> 47:48.020] have a write into the size field. [47:48.020 --> 47:50.120] They need to shift it one... [47:50.920 --> 47:51.800] Or I guess eight bytes [47:51.800 --> 47:54.160] forward to get an overwrite into [47:54.160 --> 47:56.020] the next field. They are [47:56.480 --> 47:58.260] eight A's in their payload away [47:58.260 --> 47:59.960] from getting next overwrite. [48:03.260 --> 48:03.940] And if they [48:03.940 --> 48:05.320] had the stroke, they'd know. [48:06.880 --> 48:07.960] How long? [48:09.620 --> 48:10.400] Eight minutes [48:10.400 --> 48:11.380] to sudden death. [48:13.360 --> 48:14.140] Wow, yep. [48:14.140 --> 48:16.420] We knew this was going to be a hard one. It is going to come [48:16.420 --> 48:18.940] down to the wire here. Wow, it really is. [48:19.720 --> 48:20.440] And if we have to go [48:20.440 --> 48:22.520] into sudden death, that's what we'll do. [48:23.000 --> 48:24.460] We're already running a little bit [48:24.460 --> 48:26.240] behind due to some technical difficulties. [48:26.240 --> 48:28.400] We are, yeah. We're cutting into our lunch [48:28.400 --> 48:29.780] break here, that's for sure. [48:29.960 --> 48:32.300] We do that for you. [48:33.660 --> 48:34.420] For the love of [48:34.420 --> 48:36.040] the game. Isn't that some slogan? [48:37.720 --> 48:38.520] Sounds familiar. [48:38.520 --> 48:39.600] It does, yeah. [48:40.420 --> 48:42.560] Oh, oh, oh. Item [48:43.780 --> 48:44.840] 0x7f something. [48:44.880 --> 48:46.420] We're seeing some corruption [48:46.420 --> 48:48.860] go down in that debug print. Oh, yeah. [48:50.780 --> 48:52.660] Okay, and they're going to leak that out. [48:56.010 --> 48:56.610] Print out [48:56.610 --> 48:58.630] their leak and figure out what that's... It looks like they have [48:58.630 --> 49:00.770] meted out a misalignment, maybe? [49:00.990 --> 49:02.170] I'm not 100%. [49:03.010 --> 49:04.230] Well, so if you can [49:04.230 --> 49:06.650] adjust the size on this... [49:07.690 --> 49:08.510] Well, you can get a size [49:08.510 --> 49:10.430] overwrite, but just as easily you can get an X overwrite [49:10.430 --> 49:11.950] if you shift your [49:12.410 --> 49:13.470] data forward 8. [49:13.650 --> 49:16.270] 8 more bytes. Right, but if [49:16.270 --> 49:18.510] they're trying to leverage that [49:19.050 --> 49:20.270] the size is incorrect [49:20.270 --> 49:22.310] here. Is there any way you see the exploitation [49:22.310 --> 49:24.710] from there? Yeah, totally. [49:25.990 --> 49:28.270] I mean, because it is a sequential [49:28.270 --> 49:30.490] heap allocator, it's a little bit weird [49:30.490 --> 49:32.290] because you're going to try to write past [49:32.290 --> 49:33.790] the end of program memory. [49:34.110 --> 49:36.370] I think what you might [49:36.370 --> 49:37.610] get is [49:39.070 --> 49:40.110] an allocation [49:40.110 --> 49:42.250] after then corruption of size [49:42.250 --> 49:44.330] of the chunk before, and then you [49:44.330 --> 49:46.430] get full overwrite of the chunk after. [49:46.430 --> 49:48.510] But the important part is you get an allocation [49:48.510 --> 49:50.810] after you get the... [49:50.810 --> 49:52.410] Sorry, you get an allocation after [49:52.410 --> 49:54.290] it before you get the size [49:54.290 --> 49:56.470] overwrite. So you're actually [49:56.470 --> 49:58.750] able to use that size. [49:59.270 --> 49:59.830] Right. [49:59.990 --> 50:02.450] You know, that's an option. [50:02.450 --> 50:04.250] As you can tell by me kind of stumbling [50:04.250 --> 50:05.610] through it, it's harder. [50:06.850 --> 50:08.350] It's not just, you know, you have [50:08.350 --> 50:10.190] control of the next pointer and link list. [50:11.330 --> 50:12.210] It is a way to [50:12.210 --> 50:14.690] get next pointer control. [50:14.750 --> 50:16.190] So they might take that path to it. [50:16.190 --> 50:18.110] Once again, because we saw them [50:18.870 --> 50:20.230] not annotating structs, they might [50:20.230 --> 50:22.510] have a good mental layout of what's going on here. [50:22.510 --> 50:24.210] They might be comfortable with that. That might be [50:24.210 --> 50:26.290] completely within the realm of possibility [50:26.290 --> 50:28.370] for them. I see I'm putting out [50:28.370 --> 50:28.670] some [50:32.090 --> 50:32.490] function [50:32.490 --> 50:34.450] pointers there. I think they have an idea of [50:34.450 --> 50:36.150] where they're trying to go. [50:37.730 --> 50:38.290] On the [50:38.750 --> 50:40.390] lower right hand side of the screen, you can see [50:40.390 --> 50:41.770] I'm printing out some pointers. [50:43.130 --> 50:43.990] Oh, yeah. [50:44.950 --> 50:46.530] Alright. Let's take [50:46.650 --> 50:48.510] a look at straw hat real fast. Straw hat was [50:48.510 --> 50:50.650] just highlighting the buggy line. [50:50.650 --> 50:52.590] Yeah, I saw them returning to their [50:52.990 --> 50:54.350] comment there with the triple [50:54.350 --> 50:55.270] question mark. [50:57.430 --> 50:58.910] It feels like [50:59.550 --> 50:59.950] they're [51:00.610 --> 51:02.050] still trying to work out [51:02.050 --> 51:04.010] what can I really do with this. They know something is [51:04.010 --> 51:05.990] wrong there. They've highlighted [51:05.990 --> 51:08.190] the bug. They've got the comment that nails the bug. [51:08.190 --> 51:10.010] They need to figure out how to hit it. And if they [51:10.010 --> 51:11.890] do C times 0x20... [51:11.890 --> 51:13.250] Yeah, 0x22. [51:13.650 --> 51:14.930] Sorry, just 0x22. [51:21.940 --> 51:23.540] Man, at this point, I am just [51:23.540 --> 51:25.180] rooting for these competitors. I really want to [51:25.180 --> 51:27.680] see a solve on this. They see a chunk with 0 size. [51:27.680 --> 51:29.260] So that's good. Which seems suspicious. [51:29.260 --> 51:30.860] That is very suspicious. [51:32.880 --> 51:33.280] And... [51:33.280 --> 51:35.200] I don't know. [51:35.480 --> 51:37.380] I don't know how this is going to go [51:37.380 --> 51:38.300] honestly. [51:39.920 --> 51:41.200] So doing C times... [51:41.200 --> 51:43.080] Oh, it needs to be C times 0x20. [51:43.140 --> 51:45.440] No, you forgot the 0x. [51:48.280 --> 51:48.940] That doesn't [51:48.940 --> 51:50.320] look like 32 Cs. [51:50.320 --> 51:52.620] This is the drama of CTF. [51:52.660 --> 51:53.720] Oh, man. [51:54.980 --> 51:57.020] They're so close, but that's such a [51:57.020 --> 51:58.760] simple mistake to make. [51:58.760 --> 52:01.200] Such an easy mistake to make, rather. [52:01.200 --> 52:02.880] Yeah, and you just... [52:02.880 --> 52:04.340] If you've played, [52:04.340 --> 52:06.480] you can appreciate the heartbreak. [52:06.580 --> 52:08.700] To know that you were so close, [52:08.700 --> 52:10.760] or that there's one little mistake [52:10.760 --> 52:12.520] that got you tripped up, you didn't know that [52:12.520 --> 52:14.140] you made it, and then you spent like an hour [52:14.140 --> 52:16.880] or so going down [52:16.880 --> 52:18.440] the wrong path, or thinking [52:18.440 --> 52:20.620] that what you were looking at wasn't [52:20.620 --> 52:22.760] viable when it was, in fact, the bug. [52:22.760 --> 52:24.380] Yeah. I mean, they [52:24.380 --> 52:25.800] annotated that line [52:26.400 --> 52:28.540] early, early, and then they just moved on [52:28.540 --> 52:29.700] to other things. [52:29.700 --> 52:31.660] So, I don't know if they were trying to figure out [52:31.660 --> 52:33.600] how to hit it. It's fairly straightforward to hit it. [52:33.600 --> 52:35.720] It's from every mallet call it can be hit. [52:36.420 --> 52:37.940] Well, on the Hypeboy side, [52:37.940 --> 52:40.180] I've seen in their debugger, [52:40.180 --> 52:41.800] which they just had up, [52:41.800 --> 52:44.020] looks like they're making progress. [52:44.320 --> 52:44.900] I think that they're close. [52:44.900 --> 52:46.480] Let's see, what are they doing here? [52:48.760 --> 52:49.680] They're stepping through. [52:49.680 --> 52:51.900] They have invalid items in rooms, which is right. [52:51.900 --> 52:52.780] That's great. [52:56.270 --> 52:57.450] They're going through... [52:57.450 --> 53:01.790] Oh, man. [53:01.790 --> 53:04.330] It looks like they have a consistent leak. [53:05.630 --> 53:08.270] They're just trying to figure out what to do with it. [53:10.450 --> 53:12.730] And they're checking [53:12.730 --> 53:15.010] where their allocation [53:15.010 --> 53:16.770] goes. I think they're looking [53:16.770 --> 53:19.250] for allocation into program memory, [53:19.250 --> 53:20.590] or like, you know, [53:20.590 --> 53:22.270] BSS global memory, [53:22.270 --> 53:23.970] which is the right approach. [53:23.970 --> 53:25.510] That's correct. [53:26.050 --> 53:27.890] And so, the path exploitation [53:27.890 --> 53:29.810] that it looks like they're [53:29.810 --> 53:31.770] going down is that they're looking to [53:31.770 --> 53:34.310] stage a chunk, [53:34.430 --> 53:35.990] a fake chunk, and then [53:36.670 --> 53:38.090] use that to overwrite [53:38.210 --> 53:39.210] a function pointer? [53:40.310 --> 53:42.290] Yeah, that's correct. [53:43.410 --> 53:43.710] And [53:43.710 --> 53:45.270] you can overwrite function... [53:46.150 --> 53:48.370] You can overwrite function pointer. [53:48.370 --> 53:49.610] You can... [53:49.610 --> 53:51.850] I think I just put an admin terminal in here. [53:51.850 --> 53:52.770] Did I? [53:53.150 --> 53:54.650] No, I put a win function in here. [53:54.650 --> 53:56.510] So, it's overwrite function pointer [53:56.510 --> 53:58.270] to win function. [53:58.610 --> 54:00.590] Which I didn't [54:00.590 --> 54:02.390] necessarily see either of our competitors [54:03.850 --> 54:04.650] playing with [54:04.650 --> 54:06.690] that win function, though certainly they may have just looked at [54:06.690 --> 54:08.510] it and said, yep, this is where I'm trying to get to go. [54:08.510 --> 54:10.390] Oh, they know there are two minutes left. [54:12.130 --> 54:13.050] Oh, man. [54:13.050 --> 54:14.350] It's possible, but it's going to be [54:14.350 --> 54:15.790] really close. [54:15.810 --> 54:19.090] Yeah, the time pressure is real. [54:19.990 --> 54:20.630] Capitalizing data [54:20.630 --> 54:23.130] isn't really a sign of forward progress. [54:23.130 --> 54:24.490] I'm worried here. [54:24.790 --> 54:25.870] 93 seconds. [54:25.870 --> 54:28.550] We just saw over on the Straw Hat side [54:28.550 --> 54:31.110] checking the timer. [54:31.110 --> 54:33.390] I wish we had a [54:34.270 --> 54:35.570] giant digital clock [54:35.570 --> 54:37.230] counting down over there, but really [54:37.230 --> 54:39.230] that's what they've got to gauge. [54:39.230 --> 54:40.830] How much time they have left. [54:40.830 --> 54:43.610] They feel the pressure. This is going to be tense. [54:43.610 --> 54:44.970] And it looks like both teams [54:44.970 --> 54:47.370] just kind of sitting there. [54:47.370 --> 54:50.250] Just looking, trying to figure it out. [54:50.250 --> 54:51.350] Yep, this is [54:51.350 --> 54:52.730] that part of the competition that [54:53.610 --> 54:55.810] everybody's familiar with when you're [54:56.990 --> 54:57.470] just [54:57.470 --> 54:59.390] feeling like, ah, I know [54:59.390 --> 55:01.390] there's something here, but maybe the next [55:01.390 --> 55:03.470] step isn't clear. They're writing a chunk of 24 [55:03.470 --> 55:04.890] which is right. [55:05.290 --> 55:07.290] That gives them 16 byte overwrite. [55:07.730 --> 55:09.330] So on the Hype Boy side, I think that [55:10.030 --> 55:11.170] they're on the right path. [55:11.170 --> 55:13.410] The question is just, are they going to finish [55:13.410 --> 55:14.850] before the timer runs out? [55:14.850 --> 55:16.230] Really, yeah. [55:17.290 --> 55:19.350] And they have item size [55:19.350 --> 55:21.230] being the leak. [55:22.210 --> 55:23.210] I mean, really [55:23.210 --> 55:25.390] impressive that they've [55:25.390 --> 55:26.990] gotten this far. I like the [55:26.990 --> 55:29.310] LS. They type 50, enter, enter, [55:29.310 --> 55:30.950] LS. It's just like, [55:30.950 --> 55:33.750] sorry, not that lucky. [55:35.370 --> 55:37.430] And I think we're starting to see [55:37.430 --> 55:39.190] the desperation as the speed of their [55:39.190 --> 55:40.410] of their [55:41.330 --> 55:44.070] pointers and their typing increases. [55:44.110 --> 55:45.030] Yeah. [55:45.210 --> 55:47.410] I want to say we could [55:47.410 --> 55:49.130] poll them and see if they want to go Sudden Death or [55:49.130 --> 55:51.150] continue it, but knowing CTF players, [55:51.150 --> 55:53.350] they'd continue this until retirement. [55:53.750 --> 55:55.370] Yeah. I think that we're [55:55.370 --> 55:56.790] going to go into Sudden Death. [55:57.090 --> 55:59.570] I think so. Oh, and it looks like [55:59.570 --> 56:01.350] yeah, over on the Hype Boy side, [56:01.350 --> 56:03.350] they have controlled right into Heap. [56:03.350 --> 56:04.370] Oh, 7a. [56:06.290 --> 56:07.310] But that being [56:07.310 --> 56:09.450] said, there is still another stage to this. [56:09.710 --> 56:11.670] So I guess they just didn't hack hard enough. [56:11.890 --> 56:13.810] Well, ultimately, that is [56:13.810 --> 56:15.090] really the only thing [56:15.090 --> 56:17.110] in CTF is [56:17.110 --> 56:19.090] that you either figured [56:19.090 --> 56:21.130] it out or you didn't. I mean, the challenge could be [56:21.130 --> 56:23.110] broken, but barring [56:23.110 --> 56:25.170] that, I validate it. [56:25.270 --> 56:26.870] Barring that, [56:26.870 --> 56:28.990] we knew that this was going to be a tough [56:28.990 --> 56:30.470] challenge from the get-go and [56:31.430 --> 56:32.790] confirmed, right? Yeah. [56:32.790 --> 56:35.110] Two teams, top of their game. [56:35.290 --> 56:36.930] And so now we're going to set them up [56:36.930 --> 56:38.970] against a challenge where we're pretty sure [56:38.970 --> 56:40.710] that they're going to get this quite quickly. Yes. [56:40.710 --> 56:42.510] Just a question of who's first. [56:42.510 --> 56:44.030] House of Barbie was, [56:44.030 --> 56:46.610] I want to say, the hardest [56:46.610 --> 56:48.350] Pwn Challenge we have. [56:48.770 --> 56:49.550] Yeah. [56:52.230 --> 56:54.550] For reasons, it wasn't saved until Grand [56:54.550 --> 56:56.510] Finals, which [56:56.510 --> 56:58.550] we'll find out later. But now we're [56:58.550 --> 57:00.090] going into Sudden Death. [57:00.890 --> 57:02.650] We see one of the team members, [57:02.650 --> 57:04.190] I assume, [57:04.190 --> 57:06.330] Slack messaging their team saying, [57:06.330 --> 57:07.870] yeah, Sudden Death guy, sorry. [57:09.930 --> 57:10.330] Um... [57:10.330 --> 57:11.910] Yeah, I mean, it's important to remember [57:11.910 --> 57:13.930] that this is within the [57:13.930 --> 57:15.350] larger finals [57:16.070 --> 57:17.810] ecosystem here. Like, the [57:17.810 --> 57:20.270] Nautilus game is going on. We can see their scoreboards. [57:20.270 --> 57:21.390] It is, yeah. [57:21.550 --> 57:24.110] If they're not blanking now, probably soon. [57:24.350 --> 57:25.410] No, they're not blanking. [57:25.410 --> 57:26.890] They're not blanking today. [57:26.990 --> 57:29.890] I talked to Brumley yesterday and he was so happy about it. [57:29.890 --> 57:31.450] He's like, I always hated how you [57:31.450 --> 57:34.190] blank it at the end of the day and we're the only ones that know. [57:34.510 --> 57:35.990] Or rather, he's always [57:35.990 --> 57:38.030] with PPP. So it's like, y'all are the only ones [57:38.030 --> 57:39.270] that know. [57:40.190 --> 57:42.070] Brumley being fantastic also, supporting [57:42.070 --> 57:43.930] us behind the scenes. Supporting the entire CTF [57:43.930 --> 57:45.990] team here. Yeah, really great. And definitely [57:45.990 --> 57:48.370] appreciate that. Yeah, fantastic. [57:48.370 --> 57:49.910] So, with the larger DefCon [57:49.910 --> 57:51.170] CTF finals, [57:51.810 --> 57:53.930] the winner here is going to get points for their [57:53.930 --> 57:56.030] team and... I think the winner here [57:56.030 --> 57:58.130] gets 1337 points. [57:58.130 --> 57:59.170] Fitting. Which is [58:00.150 --> 58:02.050] insane. Because, let's [58:02.050 --> 58:04.470] see, last place right now, [58:04.470 --> 58:06.490] Mhacaroni with just under [58:06.490 --> 58:09.410] 3000. To first place, [58:09.410 --> 58:10.770] MMM with... [58:10.770 --> 58:12.810] Is that 7000? [58:13.210 --> 58:14.190] So it's [58:14.190 --> 58:16.330] significant. This is not [58:16.330 --> 58:18.390] jump change points. This could [58:18.390 --> 58:20.350] really alter the rankings. Oh, yeah. [58:20.350 --> 58:21.930] And in the middle, you know, there's [58:22.770 --> 58:24.770] from 4th to... [58:24.770 --> 58:26.210] What is that? [58:26.210 --> 58:28.170] From 4th to 10th? [58:28.170 --> 58:30.030] There's a 600 point difference. [58:30.030 --> 58:31.570] So you can jump up [58:31.570 --> 58:33.570] like 6 places [58:33.570 --> 58:35.210] by winning live CTF. [58:36.630 --> 58:37.570] It's the longest [58:37.570 --> 58:39.570] running challenge. And we just got the thumbs [58:39.570 --> 58:41.290] up that we're good to go. [58:41.930 --> 58:43.730] Alright, so... [58:43.730 --> 58:45.290] Let's get ready to count it down. [58:45.610 --> 58:47.550] It hurt they didn't solve it, but let's do [58:47.550 --> 58:48.850] sudden death here. Alright. [58:49.390 --> 58:51.870] 5, 4, 3, [58:51.870 --> 58:53.690] 2, 1. Let's [58:53.690 --> 58:54.410] go. [58:55.430 --> 58:57.550] Alright. Have you tried reversing [58:57.550 --> 58:59.430] it this sudden death? [58:59.430 --> 59:00.810] Oh, man. [59:00.930 --> 59:02.790] This is an old joke [59:02.790 --> 59:04.850] from a long time ago. When we put on [59:04.850 --> 59:06.750] hack the vote at RPISec, we had [59:06.750 --> 59:09.230] an intro [59:09.890 --> 59:11.670] submission is working challenge. [59:11.730 --> 59:13.350] It was category reversing. [59:13.350 --> 59:15.170] And we just print the flag reverse and you need [59:15.170 --> 59:16.990] to flop it. So this [59:16.990 --> 59:19.210] is also because [59:19.210 --> 59:20.710] our poners hated reversing. [59:22.110 --> 59:23.290] Well, our poners [59:23.290 --> 59:25.150] hated reversing. Our reversers hated poning. [59:25.150 --> 59:26.570] Sorry, hard to reverse that. [59:26.570 --> 59:28.550] And it was kind of [59:28.710 --> 59:30.610] a joke, like, they'd always walk over to the [59:30.610 --> 59:32.610] poners and be like, oh, have you tried reversing it? [59:33.510 --> 59:34.830] So this challenge [59:34.830 --> 59:36.390] is made by Glenn. [59:36.630 --> 59:38.890] Did I see a decomp failure on Ida? [59:38.890 --> 59:40.270] Was there a decomp failure? [59:40.270 --> 59:43.290] I think that that's what's happening. Positive SP value? [59:43.290 --> 59:44.370] Something like that? [59:44.370 --> 59:46.790] So, you know, this is the risk. [59:46.790 --> 59:48.310] Everybody's using Ida, except for [59:48.310 --> 59:50.950] I believe one competitor was using Ghidra. [59:51.090 --> 59:52.890] Yeah, there was... [59:52.890 --> 59:54.610] Yeah, I think just one using Ghidra. You're [59:54.610 --> 59:56.410] right. And this is a risk. [59:56.410 --> 59:58.570] Now, I believe [59:58.570 --> 01:00:00.570] that any competitor at this level is going to be able [01:00:00.570 --> 01:00:02.690] to read this disassembly and figure [01:00:02.690 --> 01:00:04.370] out what's going on pretty quickly. [01:00:04.370 --> 01:00:06.550] We see Hydeboy scrolling through the disassembly right [01:00:06.550 --> 01:00:07.230] now. [01:00:08.810 --> 01:00:10.430] I've got to say, as one of the few [01:00:10.430 --> 01:00:11.510] non-Vector35 [01:00:12.570 --> 01:00:13.590] members here, that [01:00:14.870 --> 01:00:16.270] if you think that [01:00:17.210 --> 01:00:18.690] LiveCTF is testing their challenges [01:00:18.690 --> 01:00:20.610] in Binja, that's probably a pretty [01:00:20.610 --> 01:00:22.870] good bet. No, we test our challenges in everything, [01:00:22.870 --> 01:00:24.830] honestly. Really? Yeah, we really, really [01:00:24.830 --> 01:00:26.750] try to not... like, we [01:00:26.750 --> 01:00:29.150] do not write challenges to make Binja look good. [01:00:29.150 --> 01:00:31.070] There are some challenges where it looks worse. [01:00:31.370 --> 01:00:33.070] There are some challenges where Ida looks worse. [01:00:33.070 --> 01:00:34.730] We didn't test Ghidra. [01:00:38.820 --> 01:00:40.220] Oh, that's a big diagonal [01:00:40.220 --> 01:00:42.200] arrow in the Ida graph view. [01:00:42.280 --> 01:00:43.920] I actually haven't seen that before. [01:00:43.920 --> 01:00:46.700] I don't think I've ever seen that. [01:00:46.840 --> 01:00:48.180] Okay, here we go. So now [01:00:48.180 --> 01:00:50.260] we've got... looks like there's a fix up [01:00:50.260 --> 01:00:52.180] there that resulted in the [01:00:52.180 --> 01:00:54.220] decouplation on [01:00:54.220 --> 01:00:56.580] one side here. And then straw hat. [01:00:57.220 --> 01:00:58.280] They should be able to tell [01:00:58.280 --> 01:01:00.200] that this is a string. So, yeah, looking at [01:01:00.200 --> 01:01:02.520] those numbers, I'm guessing that's ASCII. [01:01:02.680 --> 01:01:04.320] That is, in fact, ASCII. [01:01:05.220 --> 01:01:06.560] Thank you for ASCII-ing. [01:01:08.800 --> 01:01:10.380] Sorry, I should save it for the [01:01:10.380 --> 01:01:12.560] full screen us cap. No, get your [01:01:12.560 --> 01:01:14.180] dad jokes out now, Josh. I feel like [01:01:14.180 --> 01:01:16.120] we're going to be done here soon. I have terrible news. [01:01:16.120 --> 01:01:17.520] I'm never going to run out. [01:01:18.060 --> 01:01:19.500] I'm so sorry. [01:01:20.420 --> 01:01:21.760] If that impacts [01:01:21.760 --> 01:01:23.980] your choice to continue doing this with us, [01:01:23.980 --> 01:01:25.260] you know, I understand. [01:01:25.460 --> 01:01:27.520] I'm going to need a minute to chew on that. Let's flip over to [01:01:27.520 --> 01:01:28.260] Hype Boy. [01:01:29.220 --> 01:01:31.440] So, Hype Boy. Oh, they pulled [01:01:31.440 --> 01:01:33.960] the string out, so reversing it. Yes, I have tried. [01:01:35.540 --> 01:01:35.960] Except... [01:01:35.960 --> 01:01:37.220] you know... [01:01:37.220 --> 01:01:38.860] Oh, I see anger coming out on [01:01:39.340 --> 01:01:41.280] straw hat. Anger is [01:01:41.280 --> 01:01:43.340] incredibly overkill for this. [01:01:44.200 --> 01:01:45.500] But does it work? [01:01:45.860 --> 01:01:47.200] This is a string compare [01:01:47.200 --> 01:01:48.960] to running your shell game. [01:01:49.580 --> 01:01:51.260] Oh, we're seeing anger on both [01:01:51.260 --> 01:01:52.980] sides. Are you... [01:01:52.980 --> 01:01:55.280] We're seeing anger on both sides. [01:01:56.120 --> 01:01:57.080] They're installing [01:01:57.080 --> 01:01:59.040] anger. That is not a fast [01:01:59.620 --> 01:02:00.960] installation last I checked. [01:02:00.960 --> 01:02:03.440] That might cost them some time. The very, very [01:02:03.440 --> 01:02:05.340] lucky thing is, they're on our [01:02:06.160 --> 01:02:07.120] organizer internet [01:02:07.120 --> 01:02:09.180] up to the internet, so they [01:02:09.180 --> 01:02:11.220] have really fast download. Wow. [01:02:11.220 --> 01:02:12.860] On game net, that would have been [01:02:12.860 --> 01:02:14.100] slow. [01:02:16.200 --> 01:02:17.080] Wow. [01:02:19.610 --> 01:02:21.090] Oh my goodness. [01:02:21.410 --> 01:02:23.110] Okay, so we see [01:02:23.110 --> 01:02:24.830] anger installed as root. [01:02:25.370 --> 01:02:26.730] Did we see a pseudo [01:02:26.730 --> 01:02:29.090] pip install? We saw a pseudo pip install. [01:02:29.090 --> 01:02:31.290] All the rules are being thrown out the window here. [01:02:31.290 --> 01:02:33.150] Maybe they're running in a docker container. It looks like [01:02:33.150 --> 01:02:34.970] they are. Oh, okay. [01:02:34.970 --> 01:02:35.790] Well, that works. [01:02:36.730 --> 01:02:38.070] Oh my god. [01:02:38.390 --> 01:02:40.410] Anger coming out on both sides. This is an unexpected [01:02:42.030 --> 01:02:43.150] turn of events. [01:02:43.150 --> 01:02:45.250] We are watching an anger race. [01:02:45.250 --> 01:02:48.230] It is a [01:02:48.230 --> 01:02:50.390] stir cup. With the decouplation [01:02:50.390 --> 01:02:52.350] that we're seeing on the straw hat side, [01:02:52.350 --> 01:02:55.490] you know, this... [01:02:55.490 --> 01:02:56.390] I'm guessing that [01:02:56.390 --> 01:02:58.710] the number of equations [01:02:58.710 --> 01:03:00.410] or equality checks there, that [01:03:00.410 --> 01:03:02.390] may have been what has driven them [01:03:02.390 --> 01:03:04.270] to check anger. But you see it's all [01:03:04.270 --> 01:03:07.270] ASCII. Indeed. [01:03:07.270 --> 01:03:08.390] And I believe that you can [01:03:08.390 --> 01:03:10.210] look at each one of those indices, [01:03:10.210 --> 01:03:13.010] it's decreasing, and it's character by character, [01:03:13.010 --> 01:03:13.890] but they're under so much pressure [01:03:13.890 --> 01:03:16.150] that they [01:03:16.150 --> 01:03:17.730] might be jumping. [01:03:18.190 --> 01:03:19.890] They might have figured it out. [01:03:20.870 --> 01:03:21.650] Yeah. [01:03:21.650 --> 01:03:23.070] Okay, they're just going to write a Python script [01:03:23.070 --> 01:03:26.130] to pull out what it is. [01:03:28.150 --> 01:03:29.030] Okay. [01:03:29.370 --> 01:03:31.810] I was really worried there for a second. [01:03:32.190 --> 01:03:33.930] Oh, wait a minute. But over on Hypeway, [01:03:33.930 --> 01:03:35.890] we see Linux x86 [01:03:35.890 --> 01:03:37.990] shellcode. That's a good [01:03:37.990 --> 01:03:39.970] sign. Yeah, they're pulling it up. Not using [01:03:40.630 --> 01:03:41.510] shell plus [01:03:42.970 --> 01:03:43.770] null by... [01:03:44.250 --> 01:03:45.490] Ah, that's not going [01:03:45.490 --> 01:03:46.550] to work. [01:03:48.090 --> 01:03:49.370] You need your [01:03:49.950 --> 01:03:51.650] payload first. Yes, I've tried reversing [01:03:51.650 --> 01:03:53.270] it. They put it... No, put it first! [01:03:53.270 --> 01:03:54.270] Put it first! [01:03:55.470 --> 01:03:57.570] But they're on the right track here. They are on the right [01:03:57.570 --> 01:03:59.770] track here. That might work. I might not remember [01:03:59.770 --> 01:04:00.290] the [01:04:01.470 --> 01:04:03.610] Python 3 challenge. Oh, yeah, they're [01:04:03.610 --> 01:04:05.450] under pressure. Seems like maybe [01:04:05.450 --> 01:04:07.730] you should. If they swap [01:04:08.330 --> 01:04:09.670] the order of those two, [01:04:09.670 --> 01:04:10.990] their shellcode... [01:04:10.990 --> 01:04:13.470] Do you mean if they reverse the order? [01:04:13.470 --> 01:04:15.270] Oh, my God. It's [01:04:15.270 --> 01:04:15.890] meta. [01:04:17.590 --> 01:04:19.670] If they reverse the order here, [01:04:20.190 --> 01:04:21.490] they get a shell. On the Straw Hat side... [01:04:21.490 --> 01:04:23.130] No, don't put it at the end. [01:04:23.870 --> 01:04:24.650] Oh, wait. [01:04:26.950 --> 01:04:29.610] Oh, my God. They just totally rewrote their shell. [01:04:29.610 --> 01:04:31.430] Okay. They threw out the other thing, and they [01:04:31.430 --> 01:04:33.410] just have another. On the Straw Hat side, [01:04:33.410 --> 01:04:35.670] we see them continuing... [01:04:36.330 --> 01:04:36.970] to look at this [01:04:36.970 --> 01:04:38.870] Oh, my goodness. It looks like [01:04:38.870 --> 01:04:40.890] Hypo is going to run away with it here. [01:04:41.010 --> 01:04:42.970] Straw Hat, real fast, still running [01:04:42.970 --> 01:04:44.390] their parser. [01:04:45.190 --> 01:04:46.810] Hypo over here. [01:04:46.870 --> 01:04:48.490] Should run it from remote. [01:04:49.290 --> 01:04:50.650] What? It said... [01:04:50.650 --> 01:04:52.190] Didn't they get a shell? [01:04:53.330 --> 01:04:54.790] Oh, now go get a shell. [01:04:54.790 --> 01:04:56.990] So they got the, yes, I've tried reversing it right. [01:05:01.050 --> 01:05:01.490] But... [01:05:01.490 --> 01:05:02.670] Oh, that's... [01:05:02.670 --> 01:05:04.330] And Straw Hat is still continuing [01:05:05.910 --> 01:05:06.790] to fix [01:05:06.790 --> 01:05:08.110] their script and [01:05:09.670 --> 01:05:10.790] isolate just the [01:05:10.790 --> 01:05:12.790] pieces of the equality checks. [01:05:12.790 --> 01:05:14.930] I think that they're still going down the road. [01:05:16.530 --> 01:05:17.070] Yep. [01:05:17.070 --> 01:05:18.310] We can see them printing out [01:05:19.550 --> 01:05:20.950] what the response is going to be [01:05:20.950 --> 01:05:21.730] checked against. [01:05:22.770 --> 01:05:24.510] I'm going to keep an eye over on Hypo because [01:05:24.510 --> 01:05:26.930] if they just swap, [01:05:26.930 --> 01:05:28.810] if they just put, yes, I've tried reversing it in the [01:05:28.810 --> 01:05:30.530] beginning, they win. [01:05:32.410 --> 01:05:34.770] At this point, it's really [01:05:34.810 --> 01:05:36.790] a pressure cooker. They're already exhausted from [01:05:36.790 --> 01:05:38.950] the challenge that they just went the distance [01:05:38.950 --> 01:05:39.630] on. [01:05:40.150 --> 01:05:43.010] Over on Hypo, they think it's their shell code that's wrong. [01:05:45.510 --> 01:05:46.630] Oh. [01:05:47.930 --> 01:05:48.850] They are so [01:05:48.850 --> 01:05:50.850] close. But really [01:05:50.850 --> 01:05:52.850] all you need to do is just put the string [01:05:52.850 --> 01:05:54.870] before because it's comparing from zero [01:05:54.870 --> 01:05:56.970] index. Over on Straw Hat... [01:05:57.890 --> 01:05:58.390] Oh. [01:05:58.470 --> 01:06:01.010] They're going all in on this [01:06:01.010 --> 01:06:02.850] string manipulation with Python [01:06:02.850 --> 01:06:05.230] which under this kind of time pressure... [01:06:05.230 --> 01:06:06.790] Yeah. You see that the indices are [01:06:06.790 --> 01:06:08.870] reversing. You can honestly just reverse those lines [01:06:09.610 --> 01:06:10.090] and [01:06:10.590 --> 01:06:12.490] pull out the ASCII character. [01:06:14.310 --> 01:06:14.790] Yeah. [01:06:14.790 --> 01:06:16.690] Gosh, this is tough. [01:06:17.230 --> 01:06:18.190] Yeah. [01:06:18.610 --> 01:06:20.830] So it looks like they're trying to extract out the [01:06:20.830 --> 01:06:22.850] numbers and the indices and then remap everything [01:06:22.850 --> 01:06:23.670] into a string but [01:06:24.590 --> 01:06:27.530] might be a little bit of overkill for this situation. [01:06:27.530 --> 01:06:28.230] Yeah. [01:06:28.730 --> 01:06:31.010] Hypo going through in the debugger. [01:06:31.010 --> 01:06:33.310] Looks like they see that... [01:06:33.310 --> 01:06:35.470] Is that their shell code that's executing there? [01:06:37.510 --> 01:06:38.910] Yeah, that looks like it. [01:06:38.910 --> 01:06:40.090] But then they have an IML. [01:06:40.250 --> 01:06:42.450] So something went wrong with their shell code there. [01:06:42.550 --> 01:06:44.330] Oh, it looks like maybe they're... [01:06:44.330 --> 01:06:45.170] Oh, no, they're in ops. [01:06:45.170 --> 01:06:48.610] Or maybe that was just a non-destructive [01:06:49.370 --> 01:06:50.170] operation. [01:06:50.250 --> 01:06:52.230] Because they have 0x90 in ops, right? [01:06:53.610 --> 01:06:55.110] Oh, and then they have nulls. [01:06:56.390 --> 01:06:57.050] Looks like it.