WEBVTT

00:17.250 --> 00:19.290
Welcome back, CTF fans.

00:19.450 --> 00:21.050
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:25.430
Oh my goodness.

00:25.570 --> 00:26.350
It's been crazy.

00:26.350 --> 00:28.870
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:33.970
We've got Hypeboy versus Straw Hat.

00:34.110 --> 00:35.330
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:37.790
I wrote this challenge.

00:37.790 --> 00:40.570
It's my hardest challenge that I wrote.

00:40.570 --> 00:41.730
I'm allowed to say that.

00:42.370 --> 00:44.130
I think it's going to be really good though.

00:44.130 --> 00:46.210
Both these teams are fantastic.

00:46.210 --> 00:48.430
Alright, well I'm excited to see them get at it.

00:48.430 --> 00:49.270
So let's count it down.

00:49.270 --> 00:49.450
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:06.870
Did I get backwards?

01:06.910 --> 01:09.110
Ah, top right is Hypeboy, top left is Straw Hat.

01:09.110 --> 01:09.870
That's right.

01:10.430 --> 01:12.250
At this point it looks pretty similar, right?

01:12.250 --> 01:15.390
The first step of every challenge, download the challenge.

01:15.410 --> 01:19.690
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:41.370
A lot of moving pieces.

01:41.370 --> 01:45.450
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:08.850
Oh my gosh.

02:08.850 --> 02:10.810
So we're in Grand Finals.

02:10.810 --> 02:12.810
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:40.530
Is it reachable?

02:40.530 --> 02:41.150
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:40.810
I think the description of the challenge was, like, Stidlib Malik wasn't pink enough, so we implemented our own, which also the description.

07:41.270 --> 07:44.690
For those that haven't seen the Barbie movie, 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 --> 08:03.290
Print state, it was supposed to be behind debug, but that was actually a little hard, so I just commented out the debug condition.

08:03.330 --> 08:07.570
Print state prints each room in the house, 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:15.770
Heap chunk printed with the address of it, the data address of it, size of it, whether it's free or not, and the next.

08:15.770 --> 08:20.770
So the heap here is a singly linked list, which we're going to see so much in CTFs.

08:20.770 --> 08:27.170
It's one of the most common data structures you see because that next pointer is just so valuable, especially in heap challenges.

08:27.170 --> 08:30.050
You might be able to get an arb right from it if you try hard enough.

08:30.330 --> 08:36.730
Yeah, so definitely when I was looking at this challenge, I was thinking, all right, what is the metadata 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:50.850
The print function that you mentioned really does help you understand that, and I'm interested to see when the competitors stumble across that, and we'll be able to tell 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:57.030
They're not annotating with it quite yet, but Straw Hat is.

08:57.210 --> 09:04.910
Straw Hat has already gone through and annotated part of the heap struct, I believe, 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:16.810
There's some global metadata that manages the heap 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:26.630
It's one less layer of indirection, one less allocation you need to keep track of on the heap.

09:27.670 --> 09:32.950
And both teams we're going to see going through just doing basic annotation of this.

09:32.950 --> 09:45.570
We talked about this earlier, but this is a really good way to just get your bearings in a challenge that has a couple layers to it because you have the house, you have rooms, and you have furniture, and all of those are different structs.

09:45.570 --> 09:55.090
Right, and correct me if I'm wrong here, Josh, but I think that the structs themselves, not in the binary, they're going to have to reconstruct that.

09:55.090 --> 10:05.070
They've got hints based on strings that are in it and the menu sort of saying add room, add furniture, but they're still going to do a little bit of struct reconstruction.

10:06.050 --> 10:07.010
Reconstruction, nice.

10:07.010 --> 10:08.030
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:17.230
And we've talked about this before, but again, common theme, we've got a menu here.

10:17.430 --> 10:25.590
We've got one competitor who looks like they're very static focused, so they're looking at each menu item, they're reading the function that gets called.

10:25.590 --> 10:29.930
The other competitor looked like they were exploring the menu via just sending stuff to it.

10:30.590 --> 10:40.690
Yeah, and it looks like they're just trying to get interaction down, and they're trying to print the state of the heap after each of those interactions.

10:40.690 --> 10:49.010
And what's really nice is these structs are, you know, I might have been a little nice here and made them divisible sizes.

10:49.430 --> 10:50.570
Always helpful.

10:50.890 --> 11:03.170
You might be able to just kind of shove a couple of one in the space of another, and the link list I might have forgotten to free, so you might have a couple free chunks here and there you can control.

11:04.590 --> 11:11.030
But really, this challenge was inspired by the name, obviously.

11:11.030 --> 11:14.630
And then when I started looking up, I was like, oh, what do people do for custom heap allocators?

11:14.630 --> 11:19.670
I looked through a bunch of GitHub repos, 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:34.990
Not exactly the same, but kind of the idea of it because I'm like, wow, yeah, people can really make this mistake.

11:34.990 --> 11:36.770
This is kind of a real bug.

11:36.770 --> 11:48.270
Well, so it's interesting you say that because I think that a surprising number of the challenges that we've seen, both here and in other CTFs, are usually modeled after a real bug that someone else has found.

11:48.270 --> 11:52.990
And sometimes it is literally just, 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 --> 12:04.250
Certainly some of the challenges that we've seen in this competition, I know at least one of the ones that I wrote was based on a real-world bug with a weird primitive.

12:04.510 --> 12:08.130
And I thought, hey, it would be really cool to see the challengers try their hands at this.

12:08.130 --> 12:09.390
Yeah, absolutely.

12:09.390 --> 12:13.490
And I remember I was playing in real-world CTF 20...

12:13.490 --> 12:14.730
Oh, the first one.

12:14.730 --> 12:15.930
Whenever that was.

12:16.750 --> 12:17.150
And...

12:17.150 --> 12:22.790
they had one challenge that was you know, recreate this ODE in Chrome.

12:22.790 --> 12:24.890
Oh, by the way, don't worry, we actually have it.

12:25.110 --> 12:26.390
You're not giving us an ODE.

12:26.390 --> 12:27.190
We already have it, guys.

12:27.190 --> 12:27.930
Trust us.

12:27.930 --> 12:35.150
And they had a video of them showing the ODE, which was just them running a script, then Chrome popped up, then Calc 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:43.830
So, there are definitely real-world bugs that try to be put in CTF.

12:43.830 --> 12:46.170
Sometimes, it's a little shadier than others.

12:46.170 --> 12:51.070
We decided to not do that challenge because we're like, we don't know how we feel about this.

12:51.370 --> 12:51.970
Right.

12:52.310 --> 12:58.430
Yeah, I mean, they're in good company in terms of the number of proof videos out there that just popped up.

12:58.870 --> 13:06.010
Where it's just, you know, a script that's called, like, exploit.py, and inside of it, all of us is like, subprocess.calc.exe.

13:06.010 --> 13:07.030
Great exploit.

13:07.030 --> 13:08.010
One of my favorites.

13:08.010 --> 13:20.950
So, if we switch over here to Hypeboi, we can see that they're printing out the this is the list of the chunks, and these are the different... Yeah, these are all the field values.

13:20.950 --> 13:22.530
The fields in the chunks.

13:22.590 --> 13:26.010
So, it looks like three... oh, gosh.

13:26.050 --> 13:28.450
So, they're going to be creating a room.

13:28.830 --> 13:32.290
Yeah, creating a room and adding items to it.

13:32.850 --> 13:46.990
I have to say, I really especially for a challenge like this, I think it's great to have stuff like that because for me, having heap structure stuff in my head, even with nice printouts like that, it's hard.

13:46.990 --> 13:48.530
It is hard, definitely.

13:48.530 --> 13:52.370
And unless you're really familiar with the structures, like, you can hold tcache info in your head.

13:52.370 --> 13:58.730
With a custom heap allocator, like, you need to change your understanding and you're going to be making mistakes because fields are at different places.

13:58.890 --> 14:00.110
Fields don't exist.

14:00.110 --> 14:02.870
They're different sizes, different everything.

14:02.870 --> 14:11.470
So, having that printout is really, really beneficial to just being able to do this challenge, period, let alone in the time they're given.

14:12.150 --> 14:30.810
Yeah, and I think that one of the things that is tricky with a new heap allocator is, as you were talking about, it's nice that they're at good widths because with heap stuff, typically what you're looking to do is you have these boxes, right, and you're trying to get maybe one overlaid over the other or a little bit further into them,

14:30.810 --> 14:38.310
but you have to know exactly what that structure is to know what's being overwritten or what's being placed on top of a value that used to be there.

14:38.590 --> 14:40.230
Yeah, absolutely.

14:40.230 --> 14:47.730
Like, if you have two structs of the same size, one with a function pointer at the offset of the size field of the other one, you know, that's really nice.

14:47.730 --> 15:07.250
You get arb call on size field, but if you have mismatched sizes, you know, you get , uh-oh, that function pointer is now like next pointer in the heap metadata, and it's just so like it's probably still possible, but you have to do so much heap manipulation to get there that it's just not feasible within an hour.

15:07.250 --> 15:12.130
I'm sure everybody at home has exactly the picture in their head of what Josh was just talking about.

15:12.130 --> 15:14.430
I know it's very easy.

15:14.630 --> 15:16.470
This is child's play, surely.

15:17.570 --> 15:18.530
Okay.

15:20.210 --> 15:24.390
Let's take a look here and see what Straw Hat has going on.

15:24.390 --> 15:28.470
So Straw Hat...

15:28.470 --> 15:30.250
So right now they're breaking down.

15:30.250 --> 15:31.310
So this is the free function.

15:31.310 --> 15:34.150
So the allocator, it's essentially only three functions, right?

15:34.150 --> 15:34.470
Yeah.

15:34.470 --> 15:35.890
It's, uh, what is it?

15:35.970 --> 15:39.270
Free, malloc, and realloc.

15:39.270 --> 15:39.950
Yep.

15:40.010 --> 15:46.430
And I think looking at this, you just skipped over the malloc function because you're just like, oh, it's just malloc.

15:46.430 --> 15:49.710
And you were looking for straight, like, stdlib heap bugs.

15:49.710 --> 15:50.390
Yeah.

15:50.890 --> 15:55.710
Because... Yeah, I'm like, uh, double click on malloc, and you're like, you bastard.

15:55.850 --> 15:56.350
Yeah.

15:56.350 --> 16:02.850
If you look on the left-hand side there, you can very clearly see that the malloc, free, and realloc functions don't have that pink background on them.

16:02.850 --> 16:04.610
So they're not imports.

16:04.790 --> 16:12.670
Um , so I missed that because I, you know, little detail like that, and I was looking for the bug and didn't see it.

16:12.670 --> 16:14.130
It's a really common oversight.

16:14.130 --> 16:29.130
Honestly, a big part of this is, you know, going through with a fine-tooth comb and understanding every step of the process because if you make assumptions like that, you're going to be skipping over potentially major parts of program logic and potentially where the bug is.

16:29.130 --> 16:29.430
Right.

16:29.430 --> 16:29.770
Who knows?

16:29.770 --> 16:30.070
Right.

16:30.070 --> 16:33.970
And so I'm glad to see that our competitors did not fall for that like I did.

16:33.970 --> 16:34.870
Oh, my god.

16:34.870 --> 16:41.030
I was honestly worried and I was debating renaming them, and then I'm just like, nah, I like using these names.

16:41.670 --> 16:42.090
Uh, yep.

16:42.090 --> 16:46.690
And we can see that both competitors looking at these heap implementations.

16:47.450 --> 16:47.610
Yeah.

16:47.610 --> 16:50.130
Hypeboi also looking at realloc and free.

16:50.210 --> 16:50.490
Yeah.

16:50.650 --> 17:01.290
Hypeboi probably knows that realloc is usually pretty buggy because you need to split chunks, you need to be able to shift them, join them, etc.

17:01.290 --> 17:04.290
You know, that's all this does but other heap allocators, absolutely.

17:04.810 --> 17:10.370
Um , but you might notice that splitting the chunk isn't the job of realloc.

17:10.370 --> 17:12.270
Splitting the chunk happens in malloc.

17:12.790 --> 17:20.670
Yeah, I was going to say that depending on how you want to write your heap allocator, you could end up with some of these being pretty simple.

17:20.670 --> 17:27.750
So, realloc really could just be a thin wrapper around malloc and free if you wanted to, like if you wanted to be lazy.

17:27.750 --> 17:28.930
It was originally.

17:28.930 --> 17:30.790
Um , and free.

17:31.290 --> 17:43.050
I think that if you wanted to be lazy about it, you could do basically all the work in free and have it do the consolidation of chunks and malloc just be real lazy and just, do I have a big enough free slot?

17:43.050 --> 17:44.610
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:51.750
Shade being thrown this way because that's 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:57.230
What are we looking at?

17:57.230 --> 17:58.690
We're looking at Hypeboy here.

17:58.950 --> 18:01.150
Um , yeah.

18:01.330 --> 18:07.530
Looks like they're cross-referencing those heap functions.

18:07.550 --> 18:09.190
See those calls to free there.

18:09.190 --> 18:10.910
Trying to figure out what goes inside of them.

18:10.910 --> 18:11.390
Exactly.

18:11.390 --> 18:21.030
I think once you understand that, okay, there might be a bug in one of the three allocator functions, the next step is probably, okay, where do each of these functions get used?

18:21.030 --> 18:21.210
Yeah .

18:21.210 --> 18:26.390
As far as I'm aware, the only bug in this program is in the heap allocator.

18:26.390 --> 18:30.910
It's very possible that there's another bug somewhere, like, I'm not a perfect programmer.

18:31.390 --> 18:42.070
And I would be delighted to see it because I've been saying this whole tournament that I want to see a challenger come up with an unintended solution because I know it's a possibility.

18:42.070 --> 18:49.490
We've had a little off from intended solution but we haven't had, you know, fully just wrong place, not where we expected at all.

18:49.490 --> 18:50.950
We thought this was sound.

18:51.290 --> 18:54.210
Like, I want to see someone just tear apart my code.

18:55.170 --> 19:02.330
Yeah, and especially for this one, which I think the intended solution in this one is, it's not simple, right?

19:02.330 --> 19:04.030
This is a tough challenge.

19:04.090 --> 19:04.550
Yeah.

19:04.550 --> 19:08.090
This is, I want to say, the hardest challenge I wrote for this.

19:08.450 --> 19:09.530
Both very good teams.

19:09.530 --> 19:19.570
We were saving it for later because we were worried that when players were just getting used to this, when players were still very nervous about competing, that they wouldn't solve it in time.

19:19.570 --> 19:24.550
But we're pretty confident that this won't go into sudden death, obviously, otherwise we wouldn't have fielded it.

19:25.390 --> 19:30.790
Yeah, a lot of quality control on our side is really focused on, is this hard but solvable?

19:30.850 --> 19:32.310
Yes, absolutely.

19:32.310 --> 19:35.490
So we've got a couple of levers that we can pull in this regard.

19:35.490 --> 19:41.830
We've got hints, we can add symbols or have explanatory stuff sort of sprinkled in.

19:41.830 --> 19:49.690
Oh yeah, and we've nerfed challenges, we've added win functions, we added unoptimized gadgets in there.

19:50.770 --> 19:59.710
And I'll also say that the sudden death challenges that we've seen so far weren't necessarily the ones that we thought were going to be the ones that would go the distance.

19:59.710 --> 20:00.590
Absolutely.

20:00.590 --> 20:03.210
I honestly chalk that up to nerves.

20:03.470 --> 20:07.750
Yes, this is truly a difficult situation to try to succeed in.

20:08.470 --> 20:16.090
Yeah, it's a different situation than these teams have been in before because they've competed in countless CTFs.

20:16.090 --> 20:24.910
They got here, they're used to being here, you know, you work in your team, every team has a little, almost enclave where they work with their teammates.

20:25.070 --> 20:31.110
And then you get over here, you're alone, you're against another team that you don't know the person potentially.

20:31.210 --> 20:34.190
You're on unfamiliar challenge.

20:34.930 --> 20:38.790
You have to use tools that you might have installed, you might need to download them.

20:38.790 --> 20:44.470
We saw with the LEB128 package that you needed to download the tool because no one had that obviously.

20:44.470 --> 20:46.810
I think MMM didn't end up using it, right?

20:47.210 --> 20:48.170
Oh, you're right.

20:48.170 --> 20:49.810
No, they didn't end up using it at all.

20:50.610 --> 20:59.770
But it just goes to show, like, it's a very different situation and the amount that plays into it just can't be overstated.

20:59.850 --> 21:10.530
Yeah, it's a different game and I have been in the CTF scene for a long time and one of the things that I picked up on after the first few years of playing is that it's really a big morale game.

21:10.530 --> 21:11.630
It's a psychological game .

21:11.630 --> 21:13.050
Do you feel like you have momentum?

21:13.050 --> 21:14.590
Do you feel like you're making progress?

21:14.590 --> 21:16.350
And this is a different situation.

21:16.350 --> 21:19.390
You're just behind this wall and it's just them back there.

21:19.390 --> 21:29.590
They don't have their teammates to bounce ideas off of and all they have is another fierce competitor sitting across from them and they don't know how far that person's made it yet.

21:29.590 --> 21:38.770
A big, big part of CTF is social and interaction and, you know, rubber ducking, bouncing ideas, working together on an exploit.

21:38.770 --> 21:44.490
Because we're, as commentators, we've really found out how easy it is to see bugs in someone else's code.

21:44.510 --> 21:46.690
And we know this, obviously, from, like, work, too.

21:47.030 --> 21:55.910
It's so much easier to see bugs in someone else's code when they're just sitting there writing it and, like, they're saying their logic out loud and then they write something totally 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 --> 22:02.610
Yeah, it is always easier when you're, you know, one step removed.

22:02.610 --> 22:08.790
Yeah, even a, was it, even a 10x programmer, 10x hacker needs someone to work with sometimes.

22:08.790 --> 22:10.050
Oh, I totally agree.

22:10.110 --> 22:17.330
And I think that when with this tournament in particular, we've seen a little bit of teammate rotation.

22:17.350 --> 22:18.050
Yes.

22:18.050 --> 22:23.990
But a lot of these challenges have been Pwn challenges and a lot of them have been the same competitors for... Absolutely.

22:23.990 --> 22:25.170
most of the challenges.

22:25.170 --> 22:25.650
Yeah.

22:25.650 --> 22:31.490
Or we've had people switch off because they're just like, you know, I, this isn't really my forte.

22:31.850 --> 22:34.050
I'm not doing well solo.

22:34.050 --> 22:36.250
I don't really want to be under that pressure.

22:36.250 --> 22:38.710
Or they're like, you'd be better at this.

22:38.710 --> 22:39.530
Like, go for it.

22:39.530 --> 22:44.630
These teammates all have major confidence and trust in each other because you're working on these challenges.

22:44.630 --> 22:52.150
You're spending, you know, 16 hours looking at one challenge and then you have to be able to comfortably hand off your script to someone else so you can sleep.

22:52.150 --> 22:52.650
Yeah.

22:52.650 --> 23:00.170
And trust them to not like burn it all down or ruin it or like waste those precious hours in the competition.

23:01.290 --> 23:02.290
Exactly.

23:02.390 --> 23:05.190
And we've seen that really...

23:05.190 --> 23:07.950
I think the best example was the Python challenge yesterday.

23:07.950 --> 23:18.230
We saw some fresh faces and one of the competitors was not the person who had played previously for their team but then they executed an extremely fast solve.

23:18.230 --> 23:20.530
So clearly they had a specialist on that team.

23:20.530 --> 23:23.950
They knew, hey, this is going to be your challenge and it worked out for them.

23:24.190 --> 23:24.910
Absolutely.

23:24.990 --> 23:35.970
And I think really working with these people for so long and working in these high-stress, you know, fast-paced environments, really you build knowledge of who can do 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:38.990
Exactly.

23:38.990 --> 23:39.190
Yeah.

23:39.750 --> 23:47.010
And I've heard this from a number of my friends in the community and talking to them about what makes their team good.

23:47.010 --> 23:55.310
And I think a big part of it is really understanding your teammates' strengths and knowing, I'm really struggling with this.

23:55.310 --> 24:03.810
I'm going to turn it over to this person or go to this person because I know that they're good at this sort of thing or maybe they just look at it differently.

24:03.810 --> 24:05.130
We're both good but we look at it differently.

24:05.130 --> 24:10.090
Looking at it differently is major also because it's so easy to get rabbit hole and just like...

24:10.090 --> 24:10.790
Oh yeah.

24:11.090 --> 24:11.470
Oh yeah.

24:11.470 --> 24:15.770
And that's key when you've got a teammate to say like, I don't think that this is the way to go.

24:15.770 --> 24:16.810
Yeah, this is nit guys.

24:16.810 --> 24:18.470
This is memcopy.

24:18.470 --> 24:24.490
And it is fun to see the different approaches that people have and I mean different in every sense of it.

24:24.490 --> 24:35.090
I know one good friend of mine, he is a very fast hacker but he has another teammate who is also very fast and I said, so which one of you is faster?

24:35.090 --> 24:45.750
And they looked at each other and they said, well, he types faster but I have to delete my stuff less and go back and fix less.

24:45.750 --> 24:47.650
So we're probably about a head and a head.

24:48.130 --> 25:06.930
I worked with two really good friends all throughout college and RPI sec on like crypto challenges and some reversing some web and we all have different strengths and I remember specifically when Defcon qualls, we split off from the rest of our team, went into a different room and just like closed door,

25:06.930 --> 25:07.750
like locked.

25:07.750 --> 25:10.290
We just had a big whiteboard and we're like, okay.

25:10.290 --> 25:15.470
And we all took a different part of this crypto problem and at the end just like put them all together and we got this all.

25:15.670 --> 25:15.930
Wow.

25:15.930 --> 25:22.350
It was we all know our own specific domain and work together to make one beautiful solution script.

25:22.450 --> 25:23.490
Yeah, that's great.

25:23.490 --> 25:29.990
I mean in the divide and conquer approach really works, especially when you've got some of these finals problems are massive, right?

25:29.990 --> 25:37.870
Or they'll be, you know, a common sort of thread, but okay so here's the same mini problem but solve it a thousand times, right?

25:37.870 --> 25:38.750
Could be one problem.

25:38.750 --> 25:43.510
And finals, attack, defend, you need to submit patches for it too that don't break SLA.

25:43.510 --> 25:46.890
Like you need to be able to keep the service up but fix.

25:46.890 --> 25:55.690
And one of the challenges, Torque also written by Glenn because it's cursed but is Torque and it's it's Torque.

25:55.690 --> 26:03.730
You can pop a shell in 2,000 different ways but one of those ways is you know it's how the game runs.

26:03.730 --> 26:05.330
So you can't really disable it.

26:05.330 --> 26:07.170
You need to make mitigation somewhere else.

26:07.330 --> 26:11.650
So just knowing specific domains and knowing how to work together is crazy.

26:11.650 --> 26:15.250
Here alone it looks like Hypeboy has been making good progress.

26:15.250 --> 26:16.690
They've been writing interaction wrappers.

26:16.690 --> 26:20.550
They're checking the offset from heap base.

26:20.550 --> 26:24.510
If I want to be really nice I could have had fixed base but I'm not that nice.

26:25.110 --> 26:28.090
Well they do, they can print out the addresses whenever they want, right?

26:28.090 --> 26:31.010
Yeah but then you need to write a parser and it's like who wants to parse?

26:33.050 --> 26:37.910
It's not like I give them really nice output that helped me a lot in solving this.

26:37.910 --> 26:44.750
Yep, those info leaks they come in handy especially when you're in a speed challenge like this.

26:44.970 --> 26:45.810
Oh yeah.

26:46.130 --> 26:53.130
And what I haven't noticed yet is anyone highlighting the real bug here?

26:53.130 --> 26:54.610
What function are we in?

26:54.750 --> 26:56.230
We're in malloc here?

26:56.230 --> 26:56.890
Oh!

26:56.890 --> 26:57.990
Wait, hang on.

26:57.990 --> 26:58.950
He's reading the line.

26:58.950 --> 27:01.450
Line 52 where the bug is.

27:01.630 --> 27:03.270
He's walking through it.

27:03.270 --> 27:07.770
If he does size minus delta he's just checking size.

27:08.210 --> 27:10.250
So I did this exact same thing.

27:10.250 --> 27:13.530
I looked at that exact thing and I was like, huh, I wonder why he did that.

27:13.530 --> 27:16.330
And then I forgot to comment it and it just went out of my head.

27:16.330 --> 27:18.550
I really want to see the comment, this is the bug.

27:18.550 --> 27:20.450
You're like, he's thinking about it.

27:20.630 --> 27:21.310
Oh.

27:21.350 --> 27:32.670
So the bug here being that you're checking the wrong size field is bigger than twice the size, or sorry the size of the free chunk is bigger than twice the size of the size field.

27:32.670 --> 27:36.470
But the size field being checked is the requested size.

27:36.470 --> 27:37.710
I love that comment.

27:37.710 --> 27:39.250
Is the requested size.

27:39.250 --> 27:41.430
Not the allocated size.

27:41.430 --> 27:49.150
So you get a chunk that has the size of the heap metadata overwrite into the next chunks info.

27:49.850 --> 27:52.230
Which, you know, it's the entire thing.

27:52.230 --> 27:58.690
So you have arbitrary you can allocate basically a fake chunk.

27:58.690 --> 28:00.870
And then you get arbrite.

28:01.210 --> 28:02.290
Using the next pointer?

28:02.550 --> 28:04.510
Yeah, using next pointer.

28:04.810 --> 28:16.130
And it's what's going to be really important is the second part of this challenge which is finding an offset that they write to that doesn't cause a next pointer to be an invalid deref in crash.

28:16.130 --> 28:16.790
Ah, right.

28:16.790 --> 28:17.290
Yeah.

28:17.290 --> 28:18.570
So that's the second part of this challenge.

28:18.570 --> 28:19.630
There's a couple of pieces here.

28:19.630 --> 28:24.450
There are a couple of pieces, but Straw Hat finding the line with the bug is big.

28:24.450 --> 28:29.190
And they did go right into writing their script which, that's a good sign.

28:29.190 --> 28:36.570
Now, over on Hypoi, it looks like they're walking through the removal code.

28:36.570 --> 28:39.110
I really hope they've looked at malloc and everything.

28:39.110 --> 28:40.470
I think they have.

28:40.510 --> 28:43.950
We did see them exploring looking at the implementation.

28:43.950 --> 28:45.410
I don't think we saw them.

28:45.410 --> 28:46.950
So they know it's not standard.

28:46.990 --> 28:47.770
Right.

28:47.870 --> 28:51.430
And the category of this challenge we gave them was custom heap allocator.

28:51.690 --> 28:52.930
They came in knowing.

28:52.930 --> 28:54.870
They really should know.

28:54.870 --> 28:58.450
We made sure that they weren't going to just scan over it.

28:59.370 --> 29:00.810
But I really want to see.

29:00.810 --> 29:03.750
I think right now they're looking for double freeze.

29:03.810 --> 29:05.410
But they're noticing...

29:05.410 --> 29:08.330
No, they're not looking for double freeze because they're in add room remove room.

29:08.330 --> 29:12.610
So I think what they're trying to do is make room size mismatch.

29:12.950 --> 29:15.590
Which is close.

29:15.750 --> 29:25.030
Well, I'll say that if the category is custom heap allocator, that's still, you know, a number of bugs could be under that category, right?

29:25.030 --> 29:25.550
Yeah.

29:25.550 --> 29:30.390
When I was developing this, I was debating, like, oh, do we forget to set free in, like, a chunk split?

29:30.810 --> 29:37.810
Or do we forget to, like, update the data point or the next pointer and it points into your data?

29:37.950 --> 29:40.490
And it could be so many different things.

29:41.530 --> 29:49.590
But I think... Yeah , Hypo is going to be going through and trying to figure out, you know, a standard heap bug.

29:49.590 --> 29:50.350
Is it UAF?

29:50.350 --> 29:52.510
Is it a known house of besides House of Barbie?

29:52.510 --> 29:53.630
Yep.

29:53.630 --> 29:59.270
I mean, my immediate thought looking at this was, okay, are we looking at double free?

29:59.270 --> 30:04.130
Is this heap buffer overflow and some friendly metadata that can be smashed?

30:04.130 --> 30:04.550
Yeah.

30:04.550 --> 30:05.970
Is it some UAF?

30:05.970 --> 30:06.650
Exactly.

30:07.210 --> 30:08.470
You know, can I...

30:08.470 --> 30:11.290
There was a challenge I always wanted to write that I'm going to leak now.

30:11.290 --> 30:17.410
But is it, like, a heap meets stack kind of thing where you get... The classic love story.

30:17.410 --> 30:18.130
Yeah.

30:18.650 --> 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:23.450
Oh my gosh.

30:23.450 --> 30:24.630
I remember those names.

30:24.630 --> 30:25.510
That's crazy.

30:25.530 --> 30:27.690
How could you forget a name like Topanga?

30:28.270 --> 30:29.530
Match made in heaven.

30:29.890 --> 30:39.490
But we saw Straw Hat just then revisiting the line, trying to figure out... It looks like trying to figure out what they can do with it, trying to figure out the right structs to use.

30:39.490 --> 30:54.790
If memory serves, which sometimes it doesn't, but in this challenge it does, you can grow the list of furniture in the room to be, you know, 32 bytes.

30:54.790 --> 30:59.650
And then the size of the furniture struct itself, 16 bytes.

31:01.010 --> 31:03.230
So, you get... What is it?

31:03.230 --> 31:09.710
The size of the header is 24 bytes plus 16 bytes.

31:09.710 --> 31:13.130
You get 16 byte overwrite into the next chunk.

31:13.130 --> 31:15.270
Okay, so we see that the first hint has dropped.

31:15.270 --> 31:16.720
Oh, the first hint dropped.

31:16.720 --> 31:18.940
Do all chunks have the correct size?

31:20.600 --> 31:27.400
Which is definitely going to be a helpful hint because at least the size field was called out in the printing, the debug printing function.

31:27.400 --> 31:28.420
So that's helpful.

31:28.980 --> 31:29.760
Absolutely.

31:29.760 --> 31:35.920
And I think that it will be most helpful for Hypeboy because Straw Hat, we think we've seen...

31:35.920 --> 31:37.300
They probably know that.

31:37.300 --> 31:38.880
They probably know.

31:38.880 --> 31:41.460
So this is going to push Hypeboy to catch up.

31:41.460 --> 31:41.720
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:46.900
One step off here.

31:46.900 --> 31:47.960
A minus 24.

31:47.960 --> 31:52.540
So the size of the chunk metadata is 24.

31:53.620 --> 31:55.720
They're going to be walking through and checking.

31:56.420 --> 31:59.960
Now, Realloc doesn't do the actual allocation itself.

31:59.960 --> 32:00.740
It calls out to malloc.

32:00.740 --> 32:06.820
So that should say to them, oh, the only place where the size is properly set is malloc.

32:06.820 --> 32:08.500
So I need to check the branches there.

32:11.730 --> 32:17.830
So they're going to be going through, stepping through, making sure that everything is the correct size.

32:18.090 --> 32:32.310
I'm a little bit worried that because they haven't gone too in-depth in the heap implementation, that they're going to be thinking that I'm, like, under-allocating for a struct, just automatically, which I'm not that nice.

32:33.050 --> 32:41.950
Well, I mean, especially when you're reversing, the size of the struct that's being allocated is usually a very strong hint because, you know, who's going to mess that up?

32:41.950 --> 32:44.650
But with the CTF challenge, you never know.

32:44.870 --> 32:45.130
True.

32:45.130 --> 32:46.990
But they should also be able to see.

32:46.990 --> 32:48.510
They have all the info printed out to them.

32:48.510 --> 32:56.610
They should do struct recovery, know the size of it, and just be able to immediately knock out, oh, this is 16, this is 32, this is also 16, and just say, oh, these are all correct.

32:56.610 --> 32:57.910
Mark them as correct and move on.

32:58.110 --> 32:58.450
Yeah.

32:58.450 --> 33:06.550
I know on one side I saw the player annotating structs, making sure that they had that in their decompilation.

33:06.550 --> 33:06.950
Yeah.

33:09.130 --> 33:12.490
I don't know if I saw that on the Hypebites side, but I might have just missed it.

33:12.630 --> 33:13.870
Not 100%.

33:13.870 --> 33:17.270
It looks like they're calculating offsets correctly.

33:17.590 --> 33:25.510
So, one other big hint here is if you get data minus address not equal to size, you know that chunk is wrong.

33:25.510 --> 33:26.730
That chunk has the wrong size.

33:26.730 --> 33:27.170
Right.

33:27.170 --> 33:30.130
Because the data of a chunk is just immediately after metadata.

33:30.850 --> 33:32.730
And they should see that.

33:33.210 --> 33:38.530
Well, so that's a little bit of a second order analysis here, which may not be immediately apparent.

33:39.350 --> 33:44.490
I mean, if you break in a debugger, if you change, the first step of this challenge is setting the name for the house.

33:44.630 --> 33:47.630
Or you can set the name for the house and get a simple allocation.

33:47.770 --> 33:56.190
If you set a debug breakpoint, print the address of the name of the house, and then print the address of the chunk, you should see oh, this is just immediately after.

33:56.870 --> 34:02.330
You know, it's a little thing that's taken for granted in standard lib heap.

34:03.030 --> 34:07.990
But you really need to get a good sense of what this does.

34:08.430 --> 34:10.330
Yeah, well, this is...

34:10.910 --> 34:15.310
I'm trying to think of the number of custom heap allocator challenges I've seen.

34:15.310 --> 34:19.670
I mean, this may be just kind of a weird thing to think about.

34:19.670 --> 34:21.510
And it's not necessarily easy.

34:21.730 --> 34:22.270
True.

34:22.270 --> 34:31.010
There have been... I was talking with Lightning and she did like a protected malloc, which was a custom heap allocator.

34:31.010 --> 34:32.410
It was almost a complete rewrite.

34:32.610 --> 34:36.810
But it was rewritten to use MD5 verification of chunk metadata.

34:37.130 --> 34:39.510
So definitely optimized for performance.

34:39.650 --> 34:40.530
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:53.470
It looks like over on Straw Hat, they're making consistent progress.

34:53.470 --> 34:56.330
They're trying to figure out can I overallocate?

34:56.330 --> 34:57.610
I'm making the size of the room.

34:57.610 --> 35:01.110
They're making the size of the room large enough here.

35:01.110 --> 35:04.370
It's important that each room has a size.

35:04.370 --> 35:05.810
Each furniture item has a size.

35:05.810 --> 35:10.770
And you can't put, you know, obviously too large furniture in a room.

35:10.770 --> 35:12.050
That doesn't make it a dream house.

35:12.050 --> 35:14.010
That makes it a nightmare house to get through the door.

35:14.290 --> 35:17.830
So, you know, let's just make them good sizes.

35:17.830 --> 35:23.910
It might also be, you know, a very convenient feel to have an arbitrary unsigned 64-bit integer in there.

35:23.910 --> 35:25.610
You know, that would be nice.

35:25.610 --> 35:26.230
Right, right.

35:26.230 --> 35:34.270
Yeah, I was thinking that one of the things that I'm thinking about looking at a heap challenge is what are the resizable things that I control?

35:34.270 --> 35:37.890
Or what arbitrary data can I stuff into it?

35:37.890 --> 35:49.210
So with, say, the names, for example, okay, so now I've got potentially a resizable amount of memory depending on how name allocation is handled.

35:49.910 --> 35:58.750
But as you said, if it can take an arbitrary unsigned integer as the size, well, now I'm thinking how is that going to be used for exploitation?

35:58.790 --> 36:00.930
Yeah, like, oh, I can write a pointer here.

36:00.930 --> 36:02.030
Where do I want to write it?

36:02.990 --> 36:05.410
And it's walking through that.

36:05.410 --> 36:09.470
So it looks like Straw Hat is writing just kind of a simple interaction wrapper.

36:09.530 --> 36:11.770
They only have add room and rename right now.

36:11.770 --> 36:13.450
Yeah, so they're working back from the bug, right?

36:13.530 --> 36:21.930
They're only writing the menu interaction that they think that they need not trying to have a wrapper function for everything in the menu.

36:21.930 --> 36:24.610
Yeah, and it might be possible to solve this with only rooms.

36:24.610 --> 36:29.530
My solution used rooms and furniture, but you could do it with only rooms, I'm sure.

36:29.530 --> 36:31.410
I mean, I think the structs are the same size.

36:31.430 --> 36:34.610
Well, the way you talk about dream houses, Josh, doesn't surprise me.

36:34.610 --> 36:37.150
How could you have a dream house with no furniture?

36:37.310 --> 36:38.210
It's so true.

36:38.210 --> 36:40.390
Well, I feel like it just makes the feng shui easier.

36:40.790 --> 36:43.810
You know, the flow of energy isn't interrupted by anything or redirected.

36:44.590 --> 36:47.230
Josh, that's the best heap feng shui joke I've heard all day.

36:47.230 --> 36:48.150
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:01.530
So it looks like over on a high point, they're...

37:01.530 --> 37:03.030
Oh, so they have a room.

37:03.030 --> 37:04.730
They're adding furniture to a room.

37:04.850 --> 37:06.030
They're allocating it.

37:06.030 --> 37:07.070
You can over-allocate this.

37:07.070 --> 37:07.590
That's fine.

37:07.590 --> 37:08.590
Adding 50.

37:10.870 --> 37:11.310
And...

37:11.310 --> 37:14.610
Looks like they have an item with no name.

37:15.090 --> 37:16.710
That's because you used up the horse.

37:18.370 --> 37:20.450
I saw a hex stump coming out.

37:20.690 --> 37:21.870
Oh, there's a hex stump.

37:21.870 --> 37:23.110
There's a seg fault.

37:23.690 --> 37:25.190
Okay, that's a good sign.

37:25.190 --> 37:26.650
That's a great sign.

37:26.650 --> 37:28.450
So they just sped ahead here.

37:28.450 --> 37:32.750
And it looks like that their reallocation...

37:32.750 --> 37:35.790
They're going to find out very soon that reallocation is very busted.

37:35.790 --> 37:39.550
If they don't find out very soon, hint two will let them know because I think it's exactly that.

37:40.430 --> 37:43.350
Or no, I made it very clear that it's not in reallocation.

37:43.350 --> 37:44.630
It's in splitting.

37:44.850 --> 37:49.650
Yes , an earlier iteration of the hints led me astray.

37:50.710 --> 37:51.430
It was...

37:51.930 --> 37:53.970
Yeah, no, I can't defend it.

37:54.250 --> 37:55.190
It was.

37:57.430 --> 38:00.250
Some other sort of excitement going on in the room right now.

38:00.610 --> 38:05.110
It's hard to tell how much is making it through the microphones, but there is a lot of action in this big room.

38:05.110 --> 38:05.870
Yeah , there is a lot.

38:05.870 --> 38:08.970
Sounds like another competition just ended, had the countdown.

38:10.170 --> 38:11.690
I'm not sure which it was.

38:11.690 --> 38:14.950
I think it was Hackasad, actually, so we might be getting our Jordan back soon.

38:15.570 --> 38:16.190
Excellent.

38:16.190 --> 38:19.910
Well, the Hackasad, very cool competition for all of our viewers.

38:19.910 --> 38:22.570
If you haven't heard of it, very cool stuff.

38:22.850 --> 38:26.810
And, you know, they've got Jordan, so obviously they've got a pretty good commentator.

38:26.810 --> 38:28.650
Their production values through the roof.

38:28.650 --> 38:29.010
Oh, yeah.

38:29.010 --> 38:30.170
Really cool stuff.

38:30.250 --> 38:35.310
So it looks like over on Hypeboy, they're getting invalid furniture items.

38:35.310 --> 38:42.330
They're getting reallocation bugs because you're going back, your furniture list is increasing, increasing, increasing.

38:42.350 --> 38:45.010
Oh, and now they're fine tuning their offsets to get that.

38:45.010 --> 38:45.310
Nice.

38:45.310 --> 38:49.610
It's increasing so much, they have a leak in the size field now, and they see it here.

38:49.610 --> 38:52.490
So they know that the size field overlaps.

38:52.610 --> 38:59.450
The size field overlaps the next heap metadata size field, or next heap metadata next pointer.

38:59.450 --> 39:00.610
That's what I meant to say.

39:01.490 --> 39:02.730
It's so clear.

39:02.930 --> 39:11.250
And knowing that, creating new furniture, they know that they're going to be able to write to that next pointer.

39:11.390 --> 39:18.770
And if you write to a next pointer, point that up, writeable memory, and then allocate something else, you can get potentially an ARB write.

39:19.730 --> 39:21.910
Yeah, I think they're making great progress.

39:22.930 --> 39:23.950
Oh, yeah.

39:25.190 --> 39:33.410
I was trying to look and see in their chunk list there, in the debug prints, if we saw any pointers, it started to look like they had control.

39:33.410 --> 39:36.530
The problem is, they are over-allocating right now.

39:36.530 --> 39:42.230
So the debug print is going to print so many chunks that it's going to be hard to scroll through and find them.

39:42.970 --> 39:48.390
So I think you only need to add something like five, six furniture items max.

39:48.670 --> 39:51.490
And that's going to be a much more manageable like 20 chunks.

39:51.490 --> 39:53.190
I saw them printing out like 54.

39:54.090 --> 39:56.210
I think that this is the kind of problem.

39:56.210 --> 40:03.190
I'm a very visual guy, and for me, seeing a long list of tabular data, it's hard to visualize.

40:03.190 --> 40:06.990
And when I'm working on a challenge like this, I'm making a picture in my head.

40:06.990 --> 40:13.130
And if I can't make that picture, just due to the raw size of the data or the complexity of what I'm dealing with, it's hard.

40:13.290 --> 40:14.090
Yeah, absolutely.

40:14.090 --> 40:18.350
Honestly, it would have been really cute to write a visualization like...

40:18.350 --> 40:19.890
A Barbie house visualization?

40:19.890 --> 40:23.910
Yeah, where you can see, or like for the heap 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:37.570
Okay, and if we switch over to the raw hat side, we can see that they are examining their chunk list.

40:38.730 --> 40:41.890
They've got some large allocations going on.

40:42.190 --> 40:45.410
So that chunk size 2f is going to 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:07.160
And hint2 just dropped.

41:07.160 --> 41:10.240
So the competitors, 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:20.920
We will probably see one of them flip over and check to see if the hint has dropped here.

41:20.920 --> 41:25.220
But they're both kind of on a roll too, just judging by how 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:29.500
Hey, what's the next hint?

41:29.500 --> 41:30.540
Unless you're stuck.

41:30.540 --> 41:34.900
Yeah, I kind of want to have production go tell them hint2 dropped.

41:34.900 --> 41:37.620
But at the same time, I don't want to ruin their train of thought.

41:37.640 --> 41:38.920
I think we don't interrupt them.

41:38.920 --> 41:40.600
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:45.560
that's the way we've been running this competition.

41:45.560 --> 41:50.800
And as you said, both of these competitors seem to be on a roll, typing really fast.

41:50.800 --> 41:57.080
It's not like they just have a cursor hanging over idly , hovering things in IDA.

41:57.480 --> 41:59.720
They are moving towards the solution.

42:00.120 --> 42:02.000
Oh, got EOF.

42:02.320 --> 42:06.000
So it looks like they have next.

42:08.640 --> 42:11.500
So let's flip over to HypeBoy and take a look.

42:11.500 --> 42:12.100
Oh, thank you.

42:12.100 --> 42:12.720
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:32.080
So once they get control on this, they overwrite a pointer.

42:32.080 --> 42:33.020
What's the next step?

42:33.020 --> 42:34.900
So you overwrite the next pointer.

42:34.900 --> 42:36.320
Where are you going to point it to?

42:36.900 --> 42:39.520
Right before the got is pretty nice.

42:39.840 --> 42:42.700
Because, you know, I think this is no rel row.

42:43.600 --> 42:45.980
You can push that right before the got.

42:46.360 --> 42:54.880
Right before the got, you know, if they look around there, you might notice, oh, there's a very convenient field of zeros with, you know, some other bytes in there.

42:55.100 --> 42:57.440
So you could point it right before.

42:58.820 --> 42:59.340
Let's see.

42:59.340 --> 43:01.560
Right before 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:04.380
It's been a minute.

43:04.580 --> 43:07.380
So what's the characteristics that we're looking at here?

43:07.380 --> 43:08.260
It's readable and writable?

43:08.260 --> 43:16.920
You're looking for something that'll have a big enough size, a size that you can put, you know, ideally the house name into.

43:17.000 --> 43:19.860
Because that's the easiest thing to control.

43:19.880 --> 43:23.140
You're looking for something that has a size field that matches that.

43:23.140 --> 43:25.320
You're looking for something that has free set.

43:25.360 --> 43:31.340
That's the most important thing, is you need to have the free field set in order for that chunk to be used by any new allocation.

43:31.540 --> 43:37.420
And then you want the next pointer to be either valid or not.

43:37.620 --> 43:45.860
And so in this case, what you're doing is you're setting up a portion of memory to look like a chunk so that you can use it.

43:46.260 --> 43:50.880
You're making a fake heap chunk in, like, program memory, in the BSS.

43:50.880 --> 43:51.320
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 --> 44:01.440
I see some very active mouse work over here.

44:01.440 --> 44:05.180
I want to jump over to HypeBoy and see what they're looking at.

44:05.500 --> 44:06.420
There we go.

44:07.720 --> 44:10.500
Doing the math in their head, you could see it work out.

44:11.200 --> 44:15.660
Okay, so I see Straw Hat has picked up hint two.

44:15.660 --> 44:19.740
I didn't know hitting enter after an examine command would just, like, step forward.

44:19.740 --> 44:20.560
That's pretty nice.

44:20.560 --> 44:21.280
I didn't know that.

44:21.280 --> 44:22.660
I just always change the offset.

44:23.120 --> 44:24.940
Yeah, well, I mean, that's one of the things.

44:24.940 --> 44:34.660
I think if you are a competitor at this level, if you're not taking a look at some of the tricks that your competitors are doing, because this is all live, right?

44:36.140 --> 44:41.900
Everybody's aware that what they're going to do is going to be public, at least in that the stream is visible.

44:41.900 --> 44:44.740
So there's a lot of interesting techniques to be cleaned.

44:44.780 --> 44:45.500
Absolutely.

44:45.660 --> 44:50.140
And over on Straw Hat, we see them looking 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.040
Weren't they?

44:59.060 --> 45:00.200
Oh, no, they weren't at furniture.

45:00.200 --> 45:00.980
I'm sorry.

45:01.040 --> 45:03.120
It just looked very similar.

45:03.120 --> 45:05.920
There was a size check greater than, but it said V2.

45:06.340 --> 45:10.740
And so we don't think that we've seen them have control yet.

45:10.740 --> 45:13.240
I don't believe they've gotten a crash yet.

45:13.860 --> 45:18.460
I'm not 100% on that, but I don't know.

45:18.460 --> 45:20.640
We'll keep an eye on them for sure.

45:21.200 --> 45:27.920
It looks like over on Hype Boy, they're going into remove furniture and figuring out what it does.

45:27.920 --> 45:31.340
It actually well, you know, we'll see here.

45:31.340 --> 45:42.420
It frees the name, it frees the struct, and it decreases the size of the furniture item linked list size count field, whatever that is.

45:42.420 --> 45:44.320
It's not really important.

45:44.380 --> 45:46.480
It's just like a linked list implementation.

45:48.920 --> 45:55.060
Yeah, so part of this is really just understanding exactly what you're supposed to do with the bug.

45:55.720 --> 46:01.840
Which as we've said a couple times now, a lot of different ways to go with heap.

46:02.440 --> 46:08.340
I think that they're packing a pointer, so they're just understanding.

46:09.800 --> 46:14.160
So if I'm mistaken, have they annotated that struct, or are they just looking at offsets?

46:14.160 --> 46:15.940
No, I was just thinking that.

46:15.940 --> 46:17.900
I would really annotate that struct.

46:17.900 --> 46:21.620
That would make stuff stand out a lot clearer.

46:22.080 --> 46:31.140
Well, with more than one struct, it's definitely something, like if it was only one struct, sure, maybe you can just think about the offsets, but with more than one in play, definitely that would help.

46:31.280 --> 46:33.780
Unless do they...

46:34.720 --> 46:36.720
are they going to return to it properly?

46:39.880 --> 46:44.100
Oh, come on, you need to print out the state, looking at debugger.

46:44.300 --> 46:46.020
Oh, there we go, up there.

46:47.720 --> 46:50.600
On the straw hat side, I just saw them double-clicking.

46:50.600 --> 46:58.740
They're looking at the debug heap prints, and I saw them double-clicking on the size2f.

46:59.140 --> 47:01.540
I think that they're...

47:02.140 --> 47:05.660
Okay, now that might be just standing out because that's like slash.

47:06.600 --> 47:09.220
And it might just be...

47:09.220 --> 47:11.060
Well, let's see here.

47:11.360 --> 47:14.820
Yeah, I'm curious if they're still sort of feeling around.

47:14.820 --> 47:19.120
Maybe they know something is wrong, but they can't quite isolate it.

47:19.280 --> 47:20.540
I'm not sure.

47:20.540 --> 47:22.980
Not 100%, they have more of a wrapper now.

47:23.400 --> 47:27.100
Yeah, they're getting their interaction sorted out here.

47:27.840 --> 47:32.140
And over on Hypo, we saw them double-clicking some addresses 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:41.360
Yeah , they have a wrong size field.

47:41.360 --> 47:42.800
Size is 0x980.

47:42.800 --> 47:44.380
That's super wrong.

47:45.140 --> 47:48.020
So I think they have a write into the size field.

47:48.020 --> 47:50.120
They need to shift it one...

47:50.920 --> 47:55.240
Or I guess eight bytes forward to get an overwrite into the next field.

47:55.480 --> 47:59.960
They are eight A's in their payload away from getting next overwrite.

48:03.260 --> 48:05.320
And if they had the stroke, they'd know.

48:06.880 --> 48:07.960
How long?

48:09.620 --> 48:11.380
Eight minutes to sudden death.

48:13.360 --> 48:14.140
Wow, yep.

48:14.140 --> 48:15.800
We knew this was going to be a hard one.

48:15.800 --> 48:17.400
It is going to come down to the wire here.

48:17.400 --> 48:18.940
Wow, it really is.

48:19.720 --> 48:22.520
And if we have to go into sudden death, that's what we'll do.

48:23.000 --> 48:26.240
We're already running a little bit behind due to some technical difficulties.

48:26.240 --> 48:27.340
We are, yeah.

48:27.340 --> 48:29.780
We're cutting into our lunch break here, that's for sure.

48:29.960 --> 48:32.300
We do that for you.

48:33.660 --> 48:34.760
For the love of the game.

48:34.760 --> 48:36.040
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.160
Oh, oh, oh.

48:42.160 --> 48:44.840
Item 0x7f something.

48:44.880 --> 48:48.020
We're seeing some corruption go down in that debug print.

48:48.020 --> 48:48.860
Oh, yeah.

48:50.780 --> 48:52.660
Okay, and they're going to leak that out.

48:56.010 --> 49:00.770
Print out their leak and figure out what that's... It looks like they have meted out a misalignment, maybe?

49:00.990 --> 49:02.170
I'm not 100%.

49:03.010 --> 49:06.650
Well, so if you can adjust the size on this...

49:07.690 --> 49:13.470
Well, you can get a size overwrite, but just as easily you can get an X overwrite if you shift your data forward 8.

49:13.650 --> 49:15.270
8 more bytes.

49:15.570 --> 49:20.630
Right, but if they're trying to leverage that the size is incorrect here.

49:20.630 --> 49:23.330
Is there any way you see the exploitation from there?

49:23.530 --> 49:24.710
Yeah, totally.

49:25.990 --> 49:33.790
I mean, because it is a sequential heap allocator, it's a little bit weird because you're going to try to write past the end of program memory.

49:34.110 --> 49:46.430
I think what you might get is an allocation after then corruption of size of the chunk before, and then you get full overwrite of the chunk after.

49:46.430 --> 49:50.810
But the important part is you get an allocation after you get the...

49:50.810 --> 49:55.470
Sorry, you get an allocation after it before you get the size overwrite.

49:55.470 --> 49:58.750
So you're actually 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:05.610
As you can tell by me kind of stumbling through it, it's harder.

50:06.850 --> 50:10.190
It's not just, you know, you have control of the next pointer and link list.

50:11.330 --> 50:14.690
It is a way to get next pointer control.

50:14.750 --> 50:16.190
So they might take that path to it.

50:16.190 --> 50:22.510
Once again, because we saw them not annotating structs, they might have a good mental layout of what's going on here.

50:22.510 --> 50:23.710
They might be comfortable with that.

50:23.710 --> 50:26.790
That might be completely within the realm of possibility for them.

50:26.790 --> 50:28.670
I see I'm putting out some

50:32.090 --> 50:33.290
function pointers there.

50:33.290 --> 50:36.150
I think they have an idea of where they're trying to go.

50:37.730 --> 50:41.770
On the lower right hand side of the screen, you can see I'm printing out some pointers.

50:43.130 --> 50:43.990
Oh, yeah.

50:44.950 --> 50:45.590
Alright.

50:45.930 --> 50:47.970
Let's take a look at straw hat real fast.

50:47.970 --> 50:50.650
Straw hat was just highlighting the buggy line.

50:50.650 --> 50:55.270
Yeah, I saw them returning to their comment there with the triple question mark.

50:57.430 --> 51:03.530
It feels like they're still trying to work out what can I really do with this.

51:03.530 --> 51:04.710
They know something is wrong there.

51:05.250 --> 51:06.490
They've highlighted the bug.

51:06.490 --> 51:08.190
They've got the comment that nails the bug.

51:08.190 --> 51:09.550
They need to figure out how to hit it.

51:09.550 --> 51:11.890
And if they 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:24.600
Man, at this point, I am just rooting for these competitors.

51:24.600 --> 51:25.940
I really want to see a solve on this.

51:25.940 --> 51:27.680
They see a chunk with 0 size.

51:27.680 --> 51:28.200
So that's good.

51:28.200 --> 51:29.260
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:38.300
I don't know how this is going to go 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:50.320
That doesn't 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:58.180
They're so close, but that's such a simple mistake to make.

51:58.320 --> 52:00.520
Such an easy mistake to make, rather.

52:00.960 --> 52:02.880
Yeah , and you just...

52:02.880 --> 52:06.480
If you've played, you can appreciate the heartbreak.

52:06.580 --> 52:21.720
To know that you were so close, or that there's one little mistake that got you tripped up, you didn't know that you made it, and then you spent like an hour or so going down the wrong path, or thinking that what you were looking at wasn't viable when it was,

52:21.720 --> 52:22.760
in fact, the bug.

52:22.760 --> 52:23.460
Yeah.

52:23.520 --> 52:29.700
I mean, they annotated that line early, early, and then they just moved on to other things.

52:29.700 --> 52:32.320
So, I don't know if they were trying to figure out how to hit it.

52:32.320 --> 52:33.600
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:44.020
Well, on the Hypeboy side, I've seen in their debugger, which they just had up, 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:15.890
And they're checking where their allocation goes.

53:15.890 --> 53:23.970
I think they're looking for allocation into program memory, or like, you know, BSS global memory, which is the right approach.

53:23.970 --> 53:25.510
That's correct.

53:26.050 --> 53:39.210
And so, the path exploitation that it looks like they're going down is that they're looking to stage a chunk, a fake chunk, and then use that to overwrite a function pointer?

53:40.310 --> 53:42.290
Yeah, that's correct.

53:43.410 --> 53:45.270
And 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:58.270
So, it's overwrite function pointer to win function.

53:58.610 --> 54:08.510
Which I didn't necessarily see either of our competitors playing with that win function, though certainly they may have just looked at 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:15.790
It's possible, but it's going to be really close.

54:15.810 --> 54:19.090
Yeah, the time pressure is real.

54:19.990 --> 54:23.130
Capitalizing data 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:31.110
We just saw over on the Straw Hat side checking the timer.

54:31.110 --> 54:38.970
I wish we had a giant digital clock counting down over there, but really that's what they've got to gauge.

54:38.970 --> 54:40.170
How much time they have left.

54:40.170 --> 54:41.590
They feel the pressure.

54:41.590 --> 54:43.090
This is going to be tense.

54:43.090 --> 54:45.870
And it looks like both teams just kind of sitting there.

54:46.390 --> 54:48.950
Just looking , trying to figure it out.

54:49.870 --> 55:02.110
Yep, this is that part of the competition that everybody's familiar with when you're just feeling like, ah, I know there's something here, but maybe the next step isn't clear.

55:02.110 --> 55:04.890
They're writing a chunk of 24 which is right.

55:05.290 --> 55:07.290
That gives them 16 byte overwrite.

55:07.730 --> 55:11.170
So on the Hype Boy side, I think that they're on the right path.

55:11.170 --> 55:14.850
The question is just, are they going to finish before the timer runs out?

55:14.850 --> 55:16.230
Really, yeah.

55:17.290 --> 55:21.230
And they have item size being the leak.

55:22.210 --> 55:26.390
I mean, really impressive that they've gotten this far.

55:26.390 --> 55:28.090
I like the LS.

55:28.090 --> 55:30.010
They type 50, enter, enter, LS.

55:30.010 --> 55:33.750
It's just like, sorry, not that lucky.

55:35.370 --> 55:44.070
And I think we're starting to see the desperation as the speed of their of their pointers and their typing increases.

55:44.110 --> 55:45.030
Yeah.

55:45.210 --> 55:53.350
I want to say we could poll them and see if they want to go Sudden Death or continue it, but knowing CTF players, they'd continue this until retirement.

55:53.750 --> 55:54.230
Yeah.

55:54.430 --> 55:56.790
I think that we're going to go into Sudden Death.

55:57.090 --> 55:58.410
I think so.

55:58.530 --> 56:03.350
Oh, and it looks like yeah, over on the Hype Boy side, they have controlled right into Heap.

56:03.350 --> 56:04.370
Oh, 7a.

56:06.290 --> 56:09.450
But that being 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:20.250
Well, ultimately, that is really the only thing in CTF is that you either figured it out or you didn't.

56:20.250 --> 56:25.170
I mean, the challenge could be broken, but barring that, I validate it.

56:25.270 --> 56:32.470
Barring that, we knew that this was going to be a tough challenge from the get-go and confirmed, right?

56:32.470 --> 56:32.790
Yeah.

56:32.790 --> 56:35.110
Two teams, top of their game.

56:35.290 --> 56:40.170
And so now we're going to set them up against a challenge where we're pretty sure that they're going to get this quite quickly.

56:40.170 --> 56:40.710
Yes.

56:40.710 --> 56:42.510
Just a question of who's first.

56:42.510 --> 56:48.350
House of Barbie was, I want to say, the hardest Pwn Challenge we have.

56:48.770 --> 56:49.550
Yeah.

56:52.230 --> 56:57.670
For reasons, it wasn't saved until Grand Finals, which we'll find out later.

56:57.670 --> 57:00.090
But now we're going into Sudden Death.

57:00.890 --> 57:07.870
We see one of the team members, I assume, Slack messaging their team saying, yeah, Sudden Death guy, sorry.

57:09.930 --> 57:10.330
Um...

57:10.330 --> 57:16.930
Yeah, I mean, it's important to remember that this is within the larger finals ecosystem here.

57:16.930 --> 57:18.990
Like, the Nautilus game is going on.

57:18.990 --> 57:20.270
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:34.190
He's like, I always hated how you blank it at the end of the day and we're the only ones that know.

57:34.510 --> 57:36.630
Or rather, he's always with PPP.

57:36.630 --> 57:39.270
So it's like, y'all are the only ones that know.

57:40.190 --> 57:42.850
Brumley being fantastic also, supporting us behind the scenes.

57:42.850 --> 57:44.670
Supporting the entire CTF team here.

57:44.670 --> 57:45.510
Yeah, really great.

57:45.510 --> 57:47.130
And definitely appreciate that.

57:47.130 --> 57:48.370
Yeah, fantastic.

57:48.370 --> 57:58.130
So , with the larger DefCon CTF finals, the winner here is going to get points for their team and... I think the winner here gets 1337 points.

57:58.130 --> 57:58.630
Fitting.

57:58.630 --> 58:01.030
Which is insane.

58:01.090 --> 58:07.490
Because, let's see, last place right now, Mhacaroni with just under 3000.

58:07.490 --> 58:10.770
To first place, MMM with...

58:10.770 --> 58:12.810
Is that 7000?

58:13.210 --> 58:15.490
So it's significant.

58:15.490 --> 58:18.110
This is not jump change points.

58:18.110 --> 58:20.350
This could really alter the rankings.

58:20.350 --> 58:20.350
Oh, yeah.

58:20.350 --> 58:24.770
And in the middle, you know, there's 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:35.210
So you can jump up like 6 places by winning live CTF.

58:36.630 --> 58:38.690
It's the longest running challenge.

58:38.690 --> 58:41.290
And we just got the thumbs 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:48.190
It hurt they didn't solve it, but let's do sudden death here.

58:48.190 --> 58:48.850
Alright.

58:49.390 --> 58:53.470
5, 4, 3, 2, 1.

58:53.470 --> 58:54.410
Let's go.

58:55.430 --> 58:56.270
Alright.

58:56.430 --> 58:59.430
Have you tried reversing it this sudden death?

58:59.430 --> 59:00.810
Oh, man.

59:00.930 --> 59:04.270
This is an old joke from a long time ago.

59:04.270 --> 59:11.670
When we put on hack the vote at RPISec, we had an intro submission is working challenge.

59:11.730 --> 59:13.350
It was category reversing.

59:13.350 --> 59:16.110
And we just print the flag reverse and you need to flop it.

59:16.470 --> 59:20.710
So this is also because our poners hated reversing.

59:22.110 --> 59:23.870
Well, our poners hated reversing.

59:23.870 --> 59:25.150
Our reversers hated poning.

59:25.150 --> 59:26.570
Sorry, hard to reverse that.

59:26.570 --> 59:32.610
And it was kind of a joke, like, they'd always walk over to the poners and be like, oh, have you tried reversing it?

59:33.510 --> 59:36.390
So this challenge 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:41.790
I think that that's what's happening.

59:41.790 --> 59:43.290
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:50.950
Everybody's using Ida, except for I believe one competitor was using Ghidra.

59:51.090 --> 59:52.890
Yeah, there was...

59:52.890 --> 59:54.490
Yeah, I think just one using Ghidra.

59:54.490 --> 59:54.890
You're right.

59:54.950 --> 59:56.410
And this is a risk.

59:56.410 --> 01:00:04.370
Now, I believe that any competitor at this level is going to be able to read this disassembly and figure out what's going on pretty quickly.

01:00:04.370 --> 01:00:07.230
We see Hydeboy scrolling through the disassembly right now.

01:00:08.810 --> 01:00:21.390
I've got to say, as one of the few non-Vector35 members here, that if you think that LiveCTF is testing their challenges in Binja, that's probably a pretty good bet.

01:00:21.550 --> 01:00:23.430
No, we test our challenges in everything, honestly.

01:00:23.570 --> 01:00:23.690
Really?

01:00:23.690 --> 01:00:29.150
Yeah, we really, really try to not... like, we 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:42.200
Oh, that's a big diagonal 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:47.620
Okay, here we go.

01:00:47.620 --> 01:00:55.400
So now we've got... looks like there's a fix up there that resulted in the decouplation on one side here.

01:00:55.400 --> 01:00:56.580
And then straw hat.

01:00:57.220 --> 01:00:59.420
They should be able to tell that this is a string.

01:00:59.420 --> 01:01:02.520
So, yeah, looking at 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:11.480
Sorry, I should save it for the full screen us cap.

01:01:11.480 --> 01:01:13.760
No, get your dad jokes out now, Josh.

01:01:13.760 --> 01:01:15.060
I feel like we're going to be done here soon.

01:01:15.060 --> 01:01:16.120
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:25.260
If that impacts your choice to continue doing this with us, you know, I understand.

01:01:25.460 --> 01:01:26.700
I'm going to need a minute to chew on that.

01:01:26.700 --> 01:01:28.260
Let's flip over to Hype Boy.

01:01:29.220 --> 01:01:30.680
So, Hype Boy.

01:01:30.820 --> 01:01:32.760
Oh, they pulled the string out, so reversing it.

01:01:32.760 --> 01:01:33.960
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:40.540
Oh, I see anger coming out on straw hat.

01:01:40.720 --> 01:01:43.340
Anger is incredibly overkill for this.

01:01:44.200 --> 01:01:45.500
But does it work?

01:01:45.860 --> 01:01:48.960
This is a string compare to running your shell game.

01:01:49.580 --> 01:01:51.660
Oh, we're seeing anger on both sides.

01:01:51.660 --> 01:01:52.980
Are you...

01:01:52.980 --> 01:01:55.280
We're seeing anger on both sides.

01:01:56.120 --> 01:01:57.980
They're installing anger.

01:01:57.980 --> 01:02:00.960
That is not a fast installation last I checked.

01:02:00.960 --> 01:02:02.700
That might cost them some time.

01:02:02.700 --> 01:02:10.460
The very, very lucky thing is, they're on our organizer internet up to the internet, so they have really fast download.

01:02:10.580 --> 01:02:11.220
Wow.

01:02:11.220 --> 01:02:14.100
On game net, that would have been 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:24.830
Okay, so we see anger installed as root.

01:02:25.370 --> 01:02:27.610
Did we see a pseudo pip install?

01:02:27.610 --> 01:02:29.090
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:32.850
Maybe they're running in a docker container.

01:02:32.850 --> 01:02:33.890
It looks like they are.

01:02:34.250 --> 01:02:34.970
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:39.790
Anger coming out on both sides.

01:02:39.790 --> 01:02:43.150
This is an unexpected turn of events.

01:02:43.150 --> 01:02:45.250
We are watching an anger race.

01:02:45.250 --> 01:02:48.830
It is a stir cup.

01:02:48.830 --> 01:03:03.090
With the decouplation that we're seeing on the straw hat side, you know, this... I'm guessing that the number of equations or equality checks there, that may have been what has driven them to check anger.

01:03:03.090 --> 01:03:04.830
But you see it's all ASCII .

01:03:05.010 --> 01:03:05.830
Indeed.

01:03:05.850 --> 01:03:17.730
And I believe that you can look at each one of those indices, it's decreasing , and it's character by character, but they're under so much pressure that they 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:26.130
Okay, they're just going to write a Python script 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.070
Oh, wait a minute.

01:03:33.070 --> 01:03:36.890
But over on Hypeway, we see Linux x86 shellcode.

01:03:37.370 --> 01:03:38.290
That's a good sign.

01:03:38.290 --> 01:03:39.490
Yeah, they're pulling it up.

01:03:39.490 --> 01:03:43.770
Not using shell plus null by...

01:03:44.250 --> 01:03:46.550
Ah, that's not going to work.

01:03:48.090 --> 01:03:50.850
You need your payload first.

01:03:50.850 --> 01:03:51.810
Yes, I've tried reversing it.

01:03:51.810 --> 01:03:53.270
They put it... No, put it first!

01:03:53.270 --> 01:03:54.270
Put it first!

01:03:55.470 --> 01:03:56.890
But they're on the right track here.

01:03:56.890 --> 01:03:58.470
They are on the right track here.

01:03:58.510 --> 01:03:58.970
That might work.

01:03:58.970 --> 01:04:02.630
I might not remember the Python 3 challenge.

01:04:02.630 --> 01:04:04.490
Oh, yeah, they're under pressure.

01:04:04.770 --> 01:04:06.250
Seems like maybe you should.

01:04:06.350 --> 01:04:10.990
If they swap the order of those two, their shellcode...

01:04:10.990 --> 01:04:13.470
Do you mean if they reverse the order?

01:04:13.470 --> 01:04:14.710
Oh, my God.

01:04:14.870 --> 01:04:15.890
It's meta.

01:04:17.590 --> 01:04:20.890
If they reverse the order here, they get a shell.

01:04:20.890 --> 01:04:21.490
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:28.030
Oh, my God.

01:04:28.030 --> 01:04:29.610
They just totally rewrote their shell.

01:04:29.610 --> 01:04:30.130
Okay.

01:04:30.130 --> 01:04:32.310
They threw out the other thing, and they just have another.

01:04:32.350 --> 01:04:35.670
On the Straw Hat side, we see them continuing...

01:04:36.330 --> 01:04:38.350
to look at this Oh, my goodness.

01:04:38.350 --> 01:04:40.890
It looks like Hypo is going to run away with it here.

01:04:41.010 --> 01:04:44.390
Straw Hat, real fast, still running 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:49.590
What?

01:04:49.590 --> 01:04:50.650
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:12.790
And Straw Hat is still continuing to fix their script and isolate just the 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:21.730
We can see them printing out what the response is going to be checked against.

01:05:22.770 --> 01:05:30.530
I'm going to keep an eye over on Hypo because if they just swap, if they just put, yes, I've tried reversing it in the beginning, they win.

01:05:32.410 --> 01:05:35.570
At this point, it's really a pressure cooker.

01:05:35.570 --> 01:05:39.630
They're already exhausted from the challenge that they just went the distance 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:49.810
They are so close.

01:05:50.050 --> 01:05:55.810
But really all you need to do is just put the string before because it's comparing from zero index.

01:05:55.950 --> 01:05:56.970
Over on Straw Hat...

01:05:57.890 --> 01:05:58.390
Oh.

01:05:58.470 --> 01:06:05.230
They're going all in on this string manipulation with Python which under this kind of time pressure...

01:06:05.230 --> 01:06:05.530
Yeah.

01:06:05.530 --> 01:06:07.230
You see that the indices are reversing.

01:06:07.230 --> 01:06:12.490
You can honestly just reverse those lines and 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:27.530
So it looks like they're trying to extract out the numbers and the indices and then remap everything into a string but 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:50.170
Or maybe that was just a non-destructive 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.

