WEBVTT

00:11.580 --> 00:13.300
And we're back.

00:13.300 --> 00:15.260
Live CTF here at DEF CON.

00:15.300 --> 00:18.820
And I'm Mark Griffin and I'm joined this time by Josh from Vector35.

00:18.820 --> 00:22.280
Yeah, Josh aka Negasora on everything I'm on.

00:22.480 --> 00:24.480
And it's been fun working on this.

00:24.480 --> 00:26.500
It's my first time on camera for it.

00:26.600 --> 00:28.880
I think, oh my gosh, maybe ever.

00:28.880 --> 00:29.640
You're welcome.

00:29.640 --> 00:31.900
Yeah, thank you so much seasoned veteran like yourself.

00:31.900 --> 00:32.300
Yeah, right.

00:32.300 --> 00:33.040
My second time.

00:33.040 --> 00:33.760
Yeah.

00:34.700 --> 00:39.760
No, but I've been working behind the scenes and just set up infrastructure to be one script that works.

00:39.940 --> 00:42.640
So I think without further ado.

00:42.640 --> 00:43.400
Yeah, let's get into it.

00:43.400 --> 00:44.940
So again, this is the third challenge.

00:44.940 --> 00:46.420
We got matches five and six.

00:46.440 --> 00:51.220
Bluewater versus Macaroni and we'll be commenting Super Dice Code versus Hypoid.

00:51.220 --> 00:51.780
Yeah.

00:51.780 --> 00:55.060
So Bluewater, Macaroni, team one versus team eight seated.

00:55.280 --> 01:00.560
And then Super Dice Code placed fourth and falls Hypoid 12th.

01:00.560 --> 01:02.580
So I think these are going to be pretty good matches.

01:02.580 --> 01:03.780
There could be an upset here.

01:04.040 --> 01:04.920
I'm excited to see it.

01:04.920 --> 01:06.200
So should we just get into it?

01:06.200 --> 01:06.600
All right.

01:06.600 --> 01:06.780
Yeah.

01:06.780 --> 01:11.920
Let's start the challenge in five, four, three, two, one.

01:12.360 --> 01:13.140
Go.

01:13.580 --> 01:14.180
Go.

01:14.180 --> 01:15.260
And we're live.

01:15.260 --> 01:16.140
Let's watch.

01:17.180 --> 01:21.240
And I think we can watch and get right into it.

01:21.240 --> 01:22.400
Oh, very nice.

01:23.860 --> 01:24.120
All right.

01:24.120 --> 01:28.480
So this is a challenge called Shop that I wrote.

01:28.940 --> 01:30.160
Oh, God.

01:30.680 --> 01:31.940
Three months ago.

01:31.940 --> 01:32.240
Yeah.

01:32.240 --> 01:34.380
Let's go three months ago and not a month ago.

01:34.380 --> 01:35.460
Super fresh in your mind.

01:35.460 --> 01:35.660
Super.

01:35.660 --> 01:36.740
Oh, it's real.

01:36.740 --> 01:38.460
You know, I still think about it.

01:38.540 --> 01:39.420
Never.

01:42.080 --> 01:43.760
It's a simple one.

01:43.760 --> 01:44.800
I'm not going to lie.

01:44.800 --> 01:56.220
You know, it should be one of the faster matches, but it should still be interesting to see the way they approach it because it is open ended enough that there are there's more than just my intended solution.

01:56.480 --> 01:56.800
Yeah.

01:56.800 --> 02:03.900
And, you know, of course, with the time pressure and the environment and these these folks have been working hard on the DEF CON CTF final.

02:03.900 --> 02:08.180
So they're under a lot of pressure, a lot of mental fatigue already, I'm guessing.

02:08.180 --> 02:12.520
So definitely even the easiest problems can become hard.

02:12.740 --> 02:13.840
Yeah, absolutely.

02:13.920 --> 02:25.320
But we see Super Dice Code getting right into it, dropping it into IDA, starting to starting to annotate, fill out the the names of everything so they can really figure out what's going on.

02:25.320 --> 02:32.700
Now, interestingly, Hypeboi, instead of dropping it directly into a decompiler, well, OK, as I say that, but they were just interacting with it.

02:32.760 --> 02:38.300
They just wanted to see what the flow was before they even took a look at it, which honestly, that's usually my approach.

02:38.300 --> 02:43.540
If I know it's not like malware in the CTF setting, I just run the thing and I'm like, OK, it prints here.

02:43.540 --> 02:46.440
Let's step back from the first print and see if anything weird happens.

02:46.440 --> 02:47.640
Then I continue forward.

02:47.840 --> 02:49.580
Yeah, you know, I find it's really interesting.

02:49.960 --> 02:54.040
There's really a lot of different opinions on how to go about it.

02:54.040 --> 03:00.540
Some people like to go completely static until they have an idea of what the bug is, and some people just want to jump in and start interacting with it.

03:00.540 --> 03:06.900
The people that just look at a binary statically and get it, like just have a solution from it.

03:06.900 --> 03:10.260
I don't know how they have the stack layout in their mind like that.

03:10.260 --> 03:14.200
I try to remember and it pulls a memory overflow.

03:14.200 --> 03:16.480
Yeah, some of my good friends.

03:16.480 --> 03:19.120
But yeah, me, I love dynamic analysis.

03:19.120 --> 03:20.660
I want to see it in the debugger.

03:21.920 --> 03:23.200
That's how I operate.

03:23.200 --> 03:25.500
And I think I already see a debugger popping open.

03:25.500 --> 03:27.060
Yeah, that's fast.

03:27.260 --> 03:28.060
Oh my gosh.

03:28.060 --> 03:32.720
OK, so they're going through the interaction loop right now, at least over on Hypeboi they are.

03:32.720 --> 03:34.300
Yeah, we're looking at Hypeboi.

03:34.380 --> 03:35.860
And let's see.

03:35.860 --> 03:37.380
So it's a shop interface.

03:37.380 --> 03:41.540
You can open accounts, you can look at shelves, log into an account.

03:42.540 --> 03:46.160
And this is a fairly standard format for a CTF problem, right?

03:46.160 --> 03:51.340
Where there's a menu and you've got different options and each option sort of presents you a different functionality.

03:51.340 --> 03:57.020
And usually it's a combination of those functionalities that you use to leverage a bug, right?

03:57.020 --> 03:57.520
Oh, yeah.

03:57.800 --> 03:58.300
Yeah.

03:58.300 --> 04:00.920
Whenever I see a menu pop up, my first thought is heap.

04:01.240 --> 04:05.480
And then if I don't see mallocs or anything in there, I'm just like this author has no idea.

04:05.720 --> 04:09.640
Yeah, well, so the last challenge, for example, no menu.

04:09.640 --> 04:11.540
It was a straight stack buffer overflow.

04:11.540 --> 04:13.040
The bug was in parsing.

04:13.040 --> 04:19.060
And in this case, we're looking at a heap bug and the menu is classic.

04:20.320 --> 04:26.500
Though I think that this one, it's not exactly your typical heap, right?

04:26.500 --> 04:31.900
Like usually there's like one setup, add, delete, print sort of thing.

04:31.900 --> 04:33.800
It looked like there was a little bit more going on in this one.

04:33.800 --> 04:34.960
There's a little more going on.

04:34.960 --> 04:39.340
You have to do a little bit of heap manipulation to actually get things to line up where you want it.

04:39.720 --> 04:45.260
The gist of it and actually super dice code just was in the win.

04:45.260 --> 04:46.580
Yeah, the win function here.

04:46.580 --> 04:52.900
So they already marked a condition as the win flag, which, you know, it's like an admin check kind of.

04:52.900 --> 04:53.040
Okay.

04:53.040 --> 04:55.020
I was going to ask , was it labeled win function?

04:55.020 --> 04:57.940
Because I know some of the these like faster challenges.

04:58.060 --> 04:59.820
I think yeah, this is stripped.

05:00.320 --> 05:03.120
So they're, they're working from nothing.

05:03.760 --> 05:04.320
Gosh.

05:04.320 --> 05:19.700
And that's, that is something that for me, I, I really just love it when I see symbols in a binary, if it's stripped and you have to, you have to manually annotate what each variable is or function, it can be time consuming.

05:19.700 --> 05:20.240
Yeah.

05:20.240 --> 05:23.460
Allow me to be a shill for a second, but Binary Ninja just got auto var naming.

05:23.460 --> 05:25.740
So like, honestly, it's been kind of nice.

05:25.740 --> 05:29.380
I used to, when I was testing one of your challenges, it just sped it up.

05:29.940 --> 05:30.800
And that's a good point.

05:30.800 --> 05:49.820
And you know, one of the things that I'm interested to see here is that we've got amazing competitors with really all sorts of tools, but I think that I've largely just been seeing IDA and debugger use and, you know, phone tools for scripting, but not a whole lot else.

05:49.820 --> 05:59.980
And I was curious what people might bring to these challenges, whether it's something like anger, symbolic execution, or, or the shellfish team didn't go for anger, right?

05:59.980 --> 06:08.920
I I'm thinking it's a second language for them, which it probably is, but I does their first language, especially, I think it was Kyle bought for shellfish.

06:08.920 --> 06:10.200
So that doesn't surprise me.

06:12.100 --> 06:15.900
But yeah, but with a bug like this, what, what, what's your approach?

06:15.900 --> 06:23.080
So you, we've talked about, okay, so there's a menu, but you know, what's your approach for trying to find a bug when you see that menu?

06:23.080 --> 06:24.300
What are you looking for?

06:24.300 --> 06:29.060
So when I see that menu, I want to look for like misuses.

06:29.660 --> 06:40.700
So passing to realloc, malloc zero, you know, just like an unchecked free, especially in custom memory implementations.

06:40.700 --> 06:41.860
That's a really big one.

06:42.020 --> 06:43.700
So those are the first step.

06:43.700 --> 06:46.300
And then I go through, I annotate structures.

06:46.300 --> 06:49.720
I want to see like, is it going to be a fast spin thing?

06:49.720 --> 06:51.240
Is it going to be a T-cache thing?

06:51.340 --> 06:56.820
Like, because if it's a T-cache thing, you know, it's ABC, it's like a formula.

06:58.140 --> 07:03.480
So I'm looking to see kind of what the allocated chunks would be, how they can push each other around.

07:03.540 --> 07:09.780
If I have any likely, like, or if I have an overwrite, like how far invented out it can I get, et cetera.

07:10.000 --> 07:10.540
Yeah.

07:10.540 --> 07:14.200
And, and so you brought up a fast spin T-cache.

07:14.200 --> 07:23.800
I think that it's really important for a lot of folks who are newer to this, that you can get a challenge like this, and maybe you don't know those techniques, and it can be really intimidating.

07:24.080 --> 07:28.220
But a lot of the time, it is more procedural, I think, than people make it.

07:28.220 --> 07:35.140
Once you understand the bug primitive, like, what does this really give you or allow you to do that you shouldn't be able to do?

07:35.240 --> 07:44.280
From there, as you said, you can say, oh, well, this is, this is playing into, you know, using a T-cache-based technique or something similar.

07:44.280 --> 07:45.860
Really, hacking is just that.

07:45.860 --> 07:51.060
It's building on, you know, baby steps of knowledge and kind of inching closer to your goal.

07:51.120 --> 07:59.640
And that's, you know, hackers are notorious for, you know, having code that works, but it's built on a pile of hacks.

07:59.740 --> 08:08.580
Like, but that, that's kind of a thought process you pick up, is you make tiny steps towards the eventual goal.

08:09.120 --> 08:09.360
Yeah.

08:09.360 --> 08:12.320
So, let's take a look at, let's switch over to Hypeboi here.

08:12.560 --> 08:15.900
So, what are we seeing on the, what does it look like they're doing with their debugger over there?

08:15.900 --> 08:16.280
Okay.

08:16.280 --> 08:18.600
So, they actually just got double free in T-cache.

08:18.600 --> 08:19.220
Oh.

08:19.540 --> 08:20.060
Very nice.

08:20.060 --> 08:21.080
Making good progress.

08:21.080 --> 08:22.740
Yeah, that's making great progress.

08:23.340 --> 08:24.960
I think it's making great progress.

08:24.960 --> 08:26.340
I don't remember the solution right now.

08:26.480 --> 08:28.240
It sounds really familiar.

08:28.380 --> 08:34.920
But, well, I can see, it looks like they're using Jeff as their GDB init script.

08:35.080 --> 08:39.280
And it looks like they've got a heap helper that they're using, right?

08:39.280 --> 08:41.640
To tell them what they've got.

08:41.640 --> 08:42.900
Oh, and those can be invaluable.

08:42.900 --> 08:44.540
I used that when developing this challenge.

08:44.540 --> 08:44.700
Yeah.

08:44.700 --> 08:48.060
And it was just so nice helping figure out what the layout was.

08:48.060 --> 08:49.620
I used Pwnbag, Pwndebug.

08:49.840 --> 08:52.400
But I used to use Jeff.

08:52.940 --> 08:54.560
Both of them are fantastic.

08:54.560 --> 08:56.180
Used to use PdoA before that.

08:56.180 --> 08:56.760
Yep.

08:58.760 --> 08:59.580
Let's see.

08:59.580 --> 09:02.700
So, they're going through, they're figuring out that there's a max number of users.

09:02.860 --> 09:03.900
No.

09:05.680 --> 09:08.340
Oh, they're just figuring out that users is a linked list.

09:09.100 --> 09:10.100
Okay.

09:11.480 --> 09:15.480
So, going through, figuring out how they get to the double free.

09:16.360 --> 09:19.620
And there's a common technique, or a common technique.

09:19.620 --> 09:24.640
There's a way to avoid detecting tcache double frees.

09:24.720 --> 09:27.240
And that's to something in between.

09:27.600 --> 09:28.080
You know?

09:28.080 --> 09:29.220
It's dumb.

09:30.040 --> 09:33.140
But glibc is itself.

09:34.660 --> 09:35.460
So, let's see.

09:35.460 --> 09:39.000
Setting break points in... I shouldn't have stripped this.

09:39.000 --> 09:40.620
It makes it hard to commentate.

09:41.060 --> 09:43.980
It looks like they're setting break points in the checkout.

09:44.040 --> 09:51.820
Though I will say, it may not be easy to tell from the streams, but these folks are extremely fast.

09:51.820 --> 09:52.900
Oh, they're crazy fast.

09:52.900 --> 09:55.300
They are annotating as they're going.

09:55.300 --> 09:56.820
And they're typing so fast.

09:56.820 --> 10:00.720
If we had them on the stream, you know, it's just... Oh, it's wild.

10:00.720 --> 10:01.300
It's crazy.

10:01.300 --> 10:02.020
You see the people...

10:02.020 --> 10:02.680
They're so fast.

10:02.680 --> 10:03.320
Yeah.

10:03.840 --> 10:08.880
And you think one person is going fast and the other person just suddenly jumps like five steps ahead of them.

10:08.880 --> 10:17.680
It was last match, I think, where... no, two matches ago, where someone was building a ROP chain before the other guy even started.

10:17.680 --> 10:20.100
Other guy just knocked one out immediately.

10:20.100 --> 10:21.100
The guy was still debugging.

10:21.100 --> 10:22.380
The first guy was still debugging it.

10:22.380 --> 10:24.440
He's like, oh, my God, I can't believe it.

10:24.480 --> 10:29.760
When you're in these high-pressure, you know, race situations, your thinking just goes all over the place.

10:29.760 --> 10:31.060
Your heart rate's up.

10:31.240 --> 10:33.220
You're thinking, like, oh, how far is he?

10:33.220 --> 10:34.640
Did he find something I didn't like?

10:34.640 --> 10:36.140
He's been paused for kind of a long time now.

10:36.140 --> 10:37.500
Is he just watching his script run?

10:37.500 --> 10:40.140
Like, so many things going through your mind.

10:41.020 --> 10:45.060
Yeah , I really feel like it's stops and starts, you know?

10:45.060 --> 10:45.960
Like, you will be...

10:46.340 --> 10:48.240
okay, I see what I need to do here.

10:48.240 --> 10:48.940
Get there.

10:48.940 --> 10:51.800
And then you need to stop and think and explore what's the next step.

10:51.800 --> 10:56.640
And then, especially at this level, once they know what that next step is, they are off to the races.

10:56.640 --> 10:57.200
Oh, yeah.

10:57.200 --> 10:58.680
And it's just bing, bing, bing, bing.

10:58.680 --> 11:01.360
And then, okay, what's the next thing that they have to figure out?

11:01.360 --> 11:04.800
Getting from point A to B is something they've done thousands of times.

11:04.800 --> 11:05.220
Yeah, yeah.

11:05.220 --> 11:06.240
There really is a lot of practice.

11:06.240 --> 11:19.880
In fact, before we went live on the stream on the last one, I saw one of the competitors pop and open a challenge binary from a year past or something and practicing right there, right before they went into this match.

11:19.880 --> 11:21.380
Getting his APM up.

11:21.620 --> 11:22.460
Oh, my God.

11:22.460 --> 11:31.100
You know, you can't... there's so much work that goes into building the knowledge and the reflexes that these competitors have.

11:31.100 --> 11:32.080
Oh, yeah.

11:32.260 --> 11:39.020
And just kind of the sixth sense you get for it, like something sticks out to you that looks totally mundane and you don't know why.

11:39.300 --> 11:49.380
Yeah, that's... I think that that's something that I hear from pretty much every really seasoned CTF player or vulnerability researcher is, this looks wrong.

11:49.380 --> 11:50.440
There's something wrong here.

11:50.440 --> 11:54.820
I may not be able to tell you yet what it is, but I know something's wrong.

11:54.860 --> 11:57.580
Let's pop over to SuperDiceCode.

11:58.040 --> 12:04.920
Now, they're still going through labeling a lot of this stuff.

12:05.520 --> 12:10.740
It looked like they had a little bit more progress than the last time we were looking at them.

12:10.740 --> 12:16.020
So, it looks like they're looking for overflowing a field in the password entry.

12:16.420 --> 12:22.160
So, they've annotated in the comments some field offsets is what it looked like or maybe sizes.

12:22.300 --> 12:24.560
And now they're typing out the struct.

12:24.560 --> 12:25.780
Okay, nice.

12:27.420 --> 12:28.780
Oh, yeah, they just pulled it in.

12:28.780 --> 12:30.440
Pulled out the decouplation.

12:30.480 --> 12:31.880
And now they're... yeah.

12:33.340 --> 12:34.140
Interesting.

12:36.680 --> 12:41.080
So, this is a big step of the process is just figuring out what the structs are.

12:41.780 --> 12:50.680
Because when it comes down to it, if you don't know that, you're going to be staring at I plus 18 and you're going to be thinking like, which one was that again?

12:51.120 --> 13:09.140
Yeah, this is a lot of the behind the scenes work with reverse engineering that I think if you're an old hand at it, if you're a veteran, you know there's a lot of that work that you need to do in order to really understand what's going on and have a sense.

13:09.140 --> 13:16.880
And usually, that's not a fast process, especially if you've got a strict binary or a really large binary.

13:17.480 --> 13:21.340
And so, it's really interesting with these speed matches.

13:21.680 --> 13:26.340
You don't want to be spending time annotating, but you kind of have to in order to understand.

13:26.340 --> 13:26.800
Absolutely.

13:26.800 --> 13:28.040
It's cost benefit.

13:28.040 --> 13:32.440
It's, you know, retaining knowledge in the binary versus you're losing time for it.

13:32.440 --> 13:32.900
Right.

13:32.900 --> 13:36.820
I just saw I'm checking out that admin check, which I'm sure is going to be...

13:36.820 --> 13:38.900
Well, it only lets the best admins through.

13:39.380 --> 13:40.960
It's infallible, obviously.

13:40.960 --> 13:42.260
You shouldn't even look at it.

13:45.750 --> 13:53.390
And I'm noticing here, it's interesting that they're flipping back and forth between the disassembly and the graph view and the decompilation.

13:54.250 --> 14:02.910
Yeah, going in graph view, it's really nice to see kind of interaction loops and switch cases laid out in front of you and see if there are any complex paths it can take.

14:02.910 --> 14:03.570
Yeah.

14:03.870 --> 14:05.590
And then linear is just nice.

14:05.590 --> 14:06.430
True.

14:06.430 --> 14:10.870
I don't know about you, but for decompilation, I want it linear.

14:10.870 --> 14:13.710
But when I'm looking at assembly, I want it in graph view.

14:13.870 --> 14:20.270
And I mean, I learned to RE on disassembly and graph view.

14:20.270 --> 14:21.690
So that's very comfortable for me.

14:21.690 --> 14:24.770
I know some people are linear disassembly all the way.

14:24.770 --> 14:30.210
I like linear because that's how I learned to write assembly, you know, in a file.

14:30.210 --> 14:32.610
So that's how I read it.

14:33.210 --> 14:33.870
Yeah.

14:33.870 --> 14:40.010
And I think that, you know, we were just talking about how much time you have to spend REing or annotating.

14:40.690 --> 14:54.530
One of the things that I was taught and I pass on to anybody that I teach about reverse engineering is you really want to spend as little time as possible annotating or like diving into what does this function do?

14:54.530 --> 14:59.650
Unless you're absolutely certain that that's an important function, because especially in a match like this.

14:59.650 --> 15:00.210
Oh my gosh.

15:00.210 --> 15:03.410
Imagine, you know, there's this function that doesn't really do anything.

15:03.410 --> 15:04.450
The rabbit holes.

15:04.450 --> 15:05.930
Yeah, the rabbit holes.

15:05.970 --> 15:16.830
How many times have you like just gotten dragged into like an optimized stir comp function or like something that's so obvious when you look at it, when you look back at it?

15:16.830 --> 15:17.070
Right.

15:17.070 --> 15:21.850
But when you're in there, you're just like, oh, this, this moves so much memory around, like it has to be doing something weird.

15:21.850 --> 15:22.710
There's an offset missing?

15:22.710 --> 15:25.470
No, it's totally fine.

15:26.030 --> 15:40.290
Yeah, and that's something where having the experience, the reps, understanding common algorithms and what they look like in the decompiler or in the graph, disassembly graph view can really pay off because, you know, I've been there and I'm sure you have,

15:40.290 --> 15:51.190
or been there working with a team member where they pop open a function and it's, you know, stripped or whatever, and they just look at it and go, yep, that's quicksort or that's this hash function.

15:51.210 --> 15:52.650
I don't even need to read it.

15:52.650 --> 16:00.270
No, I feel like everyone competing here has been on both sides of that, where you're looking at it and you're like, I have no idea what this is doing.

16:00.270 --> 16:02.210
And it's like, no, that's just bubble sort.

16:02.490 --> 16:10.750
Or, you know, you're looking at some algorithm on someone else's screen, just like from across the room while you're waiting for, you know, Z3 to finish sometime.

16:11.030 --> 16:16.090
And you're just like, oh, you're looking at like Winston Churchill's algorithms.

16:16.370 --> 16:18.130
I couldn't think of one.

16:18.530 --> 16:18.970
Classic.

16:18.970 --> 16:20.610
I love Winston Churchill's algorithms.

16:20.610 --> 16:22.930
One of the computers of all time.

16:23.290 --> 16:23.610
Yeah .

16:24.030 --> 16:25.250
Little known.

16:25.470 --> 16:26.130
Okay.

16:26.130 --> 16:32.750
And so on the superdice code, we see that their exploit script starting to take some shape here.

16:32.750 --> 16:40.370
They're starting to put the entries from the menu into the script itself, which to me gives an indication that they've got an idea of what they're doing.

16:40.370 --> 16:42.130
Are they breaking inside of malloc?

16:47.780 --> 16:49.440
Well, I see read.

16:49.440 --> 16:49.740
Yeah.

16:49.740 --> 16:54.380
Well, at the very, oh, yeah, they have some breakpoints inside of libc malloc.

16:54.380 --> 17:00.100
Oh, do you think that maybe they have a watch point or something that prints out?

17:00.100 --> 17:00.480
Oh, yeah.

17:00.480 --> 17:12.860
It looks like it's printing out the pointer and the size for a malloc, which is very smart, especially if you don't have one of those heap introspection tools, it sort of lays it out for you.

17:12.900 --> 17:13.280
Yeah.

17:14.000 --> 17:18.780
Well, this also just sees because, you know, you could have the heap layout in front of you, but you don't know the previous state of it.

17:18.820 --> 17:22.600
This kind of helps you figure out, oh, I need to move this allocation later.

17:22.600 --> 17:23.160
Yeah.

17:25.140 --> 17:25.660
Yeah.

17:25.660 --> 17:29.340
And I'm sure that the the tension is just mounting.

17:29.340 --> 17:34.380
And when you when you have to do that sort of thing and instrument malloc.

17:34.380 --> 17:35.260
Yeah.

17:35.820 --> 17:37.020
That's that's tough.

17:37.020 --> 17:37.220
All right.

17:37.220 --> 17:38.500
Let's take a look at Hypeboi.

17:38.500 --> 17:38.720
Yeah.

17:38.760 --> 17:41.980
Hypeboi, it looks like they're making some progress on their exploit.

17:42.460 --> 17:47.520
They have once we see it, they have interaction wrappers.

17:48.380 --> 17:49.380
No, they don't.

17:49.380 --> 17:51.320
They just have commands they're sending raw.

17:52.820 --> 17:56.740
Looks like they've got they've tried a few things based on what I'm seeing commented.

17:56.740 --> 17:57.840
Oh, yeah.

17:58.000 --> 17:59.760
And they're what is that?

17:59.760 --> 18:04.960
To creating a user to zero is add an item to cart, I think.

18:04.960 --> 18:06.400
Then they log out.

18:06.560 --> 18:09.540
OK, that's sounding like like they're moving towards the solution.

18:09.540 --> 18:10.840
It sounds like they figured something.

18:10.840 --> 18:13.040
Oh, and look, they're laying out the chunks and the sizes.

18:13.260 --> 18:14.140
OK.

18:16.280 --> 18:18.240
And you see them counting with the mouse.

18:18.320 --> 18:19.260
I love that.

18:19.260 --> 18:20.100
I do that.

18:21.000 --> 18:32.880
Yeah, I don't know about you, but it's often the case for me where I will be trying so many things out in a script that by the end of it, it's like three quarters is junk that I never went down a rabbit hole.

18:32.880 --> 18:33.920
Nope, that's not what I want to do.

18:33.920 --> 18:35.160
And just commented it out.

18:35.160 --> 18:38.060
And there's like five lines of actual work.

18:38.060 --> 18:39.960
Yeah, absolutely.

18:39.960 --> 18:42.100
Well, you have to do the work to get the final result.

18:42.600 --> 18:44.660
You can't just sit down and have a solution to this.

18:44.660 --> 18:46.620
You need to work on it.

18:46.620 --> 18:48.700
And we see him going through it really fast.

18:50.280 --> 18:53.120
Yeah, so fast, just flipping through screens.

18:53.120 --> 18:58.100
They have this understanding in their head of the shape of this and what they're trying to do.

18:58.100 --> 19:02.620
And you can see him moving between IDA and their terminal and debugger.

19:02.620 --> 19:07.140
So it looks like HiPoI hasn't defined a user struct yet.

19:07.140 --> 19:11.280
So I don't know if they're just writing it off or if there have been other places.

19:11.500 --> 19:13.600
Or maybe they just didn't assign it in that case.

19:13.920 --> 19:18.280
Well, you know, as we were saying, it takes time to build struct annotations.

19:18.280 --> 19:24.820
Depending on what you're used to doing, maybe they just felt like they didn't have time for it.

19:24.840 --> 19:26.500
True, maybe they don't need to.

19:28.340 --> 19:37.280
If we take a look on the super dice codes tied here, I think I just saw a double free or a tcache issue.

19:37.280 --> 19:38.840
So I feel like they're making progress too.

19:38.840 --> 19:40.260
Okay, very nice.

19:41.660 --> 19:47.280
Yeah, because they took kind of different approaches, it doesn't surprise me that HiPoI got the first tcache free or tcache double free.

19:48.280 --> 19:51.680
Because it looks like super dice code has way more marked up.

19:52.020 --> 19:56.680
I noticed that, yeah, as they were going on, they were consistently just annotating, annotating.

19:56.680 --> 20:04.020
Yep, we can see they're using phone debug and getting the heap helper to lay out what's going on.

20:04.020 --> 20:06.900
Yeah, it may not look it, but these are like two very different approaches.

20:06.900 --> 20:11.420
HiPoI going highly dynamic, super dice code going methodical.

20:11.460 --> 20:12.700
Well , they're both methodical.

20:12.700 --> 20:17.660
But going static and then running, you know, figuring out if his assertions hold.

20:17.660 --> 20:18.300
Right.

20:18.960 --> 20:21.340
And then going back and annotating some more.

20:22.240 --> 20:31.120
And I just saw, I don't know if we've seen checksec yet, but I am, I can't remember what the mitigations were on this.

20:31.120 --> 20:32.800
Oh, I'm surprised, yeah.

20:32.980 --> 20:33.840
Really shaped.

20:34.460 --> 20:35.740
Well, it's a heap exploit.

20:35.740 --> 20:38.980
No, no, this has like full railroad, it has pi.

20:38.980 --> 20:40.000
Okay, okay.

20:40.160 --> 20:41.500
It has canaries.

20:41.500 --> 20:52.440
This isn't, if I recall, this is more of a figure out how to do a precise corruption and you win, rather than having to do a full, you know, riprop or...

20:52.440 --> 20:52.880
Yeah.

20:52.880 --> 20:57.900
So once you get, you know, some write primitive, you...

20:59.540 --> 21:01.280
Well, no, I don't think it has pi.

21:02.920 --> 21:03.940
I don't remember.

21:03.940 --> 21:08.340
But anyway, once you get a controlled write, you overwrite the admin flag and win.

21:08.340 --> 21:11.100
There was a win function there that admins get through.

21:11.360 --> 21:13.960
Which, of course, they'll never be able to do because they're not admins.

21:13.960 --> 21:15.300
Not yet.

21:15.300 --> 21:16.980
Yeah, I don't know why they're there, it's crazy.

21:17.960 --> 21:19.720
Just a matter of time, I'm sure.

21:20.220 --> 21:25.280
Yeah, but I'm, yeah, I'm surprised there's been no checks there.

21:26.200 --> 21:28.720
I guess they just haven't found anything to warrant it.

21:29.340 --> 21:38.160
Right, well, you know, if it is a heap bug, then your first question probably is, like, what's the bug, right?

21:38.160 --> 21:38.820
Yeah.

21:40.320 --> 21:45.560
Not an admin, so we see them poking at that, seeing the system call right there.

21:45.560 --> 21:46.820
They know they want to get there.

21:47.040 --> 21:47.380
Yeah .

21:49.240 --> 21:54.580
Ah, so, yep, now they're starting to figure out, okay, what do I need to change to get there?

21:54.720 --> 21:55.660
Got it.

21:57.520 --> 22:00.760
Oh, yeah, and they're not even calling names, they're calling them chunks.

22:00.780 --> 22:03.820
They don't care what they are, they just care about the memory they use.

22:03.820 --> 22:04.500
Right.

22:07.500 --> 22:08.400
All right.

22:11.020 --> 22:22.320
Yep, okay, so we see that they've got on one side, they've used their debugger to instrument the malloc and free calls, see exactly which pointers are getting allocated when, as they're interacting with it.

22:22.320 --> 22:24.100
And that's very fast, they've got it in their head.

22:24.100 --> 22:24.780
That's really fast.

22:24.780 --> 22:27.520
Yep, this command is going to malloc the free mode.

22:29.540 --> 22:36.980
So, I feel like they're getting closer and closer.

22:36.980 --> 22:38.480
All right, error removing item.

22:41.750 --> 22:42.610
All right.

22:42.610 --> 22:43.930
Man, they're moving so fast.

22:43.930 --> 22:44.030
All right.

22:44.030 --> 22:45.990
Yeah, let's hop back over to Hypoi.

22:45.990 --> 22:49.450
And they're making good progress.

22:49.450 --> 22:52.910
Looks like they've created a second user.

22:55.070 --> 22:57.770
And we'll see what else they did once they go back to their script.

22:57.770 --> 23:03.650
We have to be faster reading, because they know these scripts really well, and we have to keep track of two of them that they're writing.

23:05.310 --> 23:15.050
Yeah, so this is, I think it's funny, this is sort of the tense time when, okay, it's not a quick solve, it's starting to drag on a little bit.

23:15.050 --> 23:19.130
Like you said, there's kind of a morale aspect, but there's also hints, right?

23:19.190 --> 23:20.570
There's two hints.

23:20.610 --> 23:24.670
I think they're at, what are they, 25 and 40 minutes?

23:25.230 --> 23:28.090
20, 35, something like that.

23:28.090 --> 23:28.270
Yeah .

23:28.270 --> 23:37.630
So, they're probably, I don't know how long we've been going here, probably right about on the first hint or so, as far as timing.

23:38.010 --> 23:52.550
And it's up to the challenge authors to figure out what is the hint that we should provide to really give them a little bit of a breakthrough, and then that second hint should really be the, all right, you've got, what, like 10 minutes left?

23:52.550 --> 23:55.950
So , it should really pretty much lay it out there for them, that second hint.

23:55.950 --> 23:57.030
Oh, it does.

23:57.090 --> 23:58.170
Oh, it does.

23:59.610 --> 24:01.870
Yeah, the first hint, not very helpful.

24:02.350 --> 24:05.010
You know, it's a nudge, it's a nub in the right direction.

24:05.010 --> 24:08.230
The second hint is shooting them out of a cannon in the right direction.

24:08.950 --> 24:10.210
Sometimes you need that.

24:10.210 --> 24:11.550
Sometimes, yeah.

24:11.550 --> 24:17.150
If you get the second hint, which, to be fair, these aren't the easiest challenges in the world.

24:17.410 --> 24:19.990
Like, these aren't your CTF 50-point challenges.

24:20.490 --> 24:28.350
Yeah, and I think that that's really important to mention here, is that we sort of categorize these as easy because we want the challengers to be able to solve them.

24:28.350 --> 24:37.250
We want it to be more of a speed competition, but it is always hard to know exactly, like, what is, what's the exact difficulty level to get right?

24:37.250 --> 24:44.330
And it's really hard to judge that when you have teams from all over the world with different specialties, different members every year.

24:45.070 --> 24:47.410
And, you know, they're the best in the world.

24:47.410 --> 24:49.170
They're at DEF CON finals.

24:49.290 --> 24:50.190
Right, right.

24:51.730 --> 25:01.310
Yeah, so going back to the hints real quick, I remember on the first challenge, there was a, we were in that moment where it was a little tense.

25:01.430 --> 25:04.210
How long is it going to take to get to a solve here?

25:05.330 --> 25:12.530
And so the first hint went out, and I'm pretty sure they looked at the hint, looked at us, and they were like, all right, I already knew that.

25:12.530 --> 25:13.750
Like, let me get back to hacking.

25:13.750 --> 25:15.090
Why are you distracting me, you know?

25:15.090 --> 25:20.850
Yeah, actually, I think the first challenge, the first challenge is pretty long, right?

25:20.850 --> 25:27.110
So on the first challenge, now remember, we are, we're doing two matches, two head-to-head matches, right?

25:27.290 --> 25:34.190
And on the first challenge, the sort of other match finished very quickly.

25:34.190 --> 25:46.330
We're announcing one match, and then the other match is, you can see one stream of each player, and those players solve it quite quickly, at least 10 or 15 minutes faster.

25:46.330 --> 25:56.170
And I think that on that, it was really a, somebody noticed a detail that the challenge author left in that made it easier that I think everybody else missed.

25:56.950 --> 26:05.430
Yeah, at the end of the first challenge, I was building the, it goes long, a sudden-death challenge, and I was building it, ready to deploy it.

26:05.530 --> 26:05.890
Yeah .

26:06.070 --> 26:11.210
But right as I finished building it, I was about to ping people that, hey, we need to go sudden-death.

26:11.210 --> 26:12.150
They got dissolved.

26:12.370 --> 26:15.850
Yeah, it was a tense moment over here at the live CTF HQ.

26:15.850 --> 26:16.530
Oh, yeah.

26:17.750 --> 26:20.150
I'm really hoping we don't go into sudden-death here.

26:20.150 --> 26:22.430
Of course, because it's my challenge, I want them to solve it.

26:22.430 --> 26:22.950
Sure.

26:22.950 --> 26:26.310
But, you know, I want to give them some closure on the challenge.

26:26.710 --> 26:27.110
Right?

26:27.110 --> 26:33.390
Oh, I know, I think I saw at least one competitor who, they just wanted to finish, you know?

26:33.390 --> 26:33.790
Oh , yeah.

26:33.790 --> 26:36.350
They didn't win, but they wanted to finish.

26:36.350 --> 26:39.430
They asked, can I stay around and just please debug my ROP chain?

26:39.430 --> 26:39.950
Yeah.

26:39.950 --> 26:41.390
Like, why didn't it work?

26:41.390 --> 26:42.170
Yeah.

26:43.070 --> 26:51.490
So let's reassess where we've got SuperDiceCode and see what works.

26:51.490 --> 26:55.950
It looks like SuperDiceCode is breaking on the admin checker once again.

26:56.010 --> 26:57.770
Setting some breakpoints in their exploits here.

26:57.770 --> 26:58.950
Oh, no, they're just calm, yeah.

26:58.950 --> 27:01.450
They look like they are on their way.

27:02.050 --> 27:03.170
Username and password.

27:03.590 --> 27:04.650
Single-stepping.

27:07.710 --> 27:10.630
They have a different pwnbag layout than I do, and it's kind of messing with my...

27:10.630 --> 27:12.490
Yeah, and they're very fast, right?

27:12.490 --> 27:16.690
So I'm used to looking at Jeff, and it's just a little bit different layout.

27:17.870 --> 27:19.650
Yeah, we have the screens on the wrong side.

27:19.650 --> 27:21.590
I have the Jeff screen and you have pwnbag.

27:21.810 --> 27:22.970
Oh, you want to switch seats?

27:22.970 --> 27:24.050
No, I'm good.

27:27.400 --> 27:28.380
Let's see.

27:29.320 --> 27:32.620
I'm definitely looking at that login.

27:32.620 --> 27:35.160
Well , SuperDiceCode is annotating everything they can.

27:35.160 --> 27:37.120
They're getting a good understanding of the program.

27:37.120 --> 27:46.220
Even if the bug hasn't immediately jumped out at them, you know, by the time they reach that intersection of their two kind of growing ends of knowledge, something will click.

27:46.660 --> 27:50.180
Yeah, and that's, as you said, the differing approaches.

27:50.420 --> 28:07.520
I tend to be more of the, I want dynamic analysis, but I really just want it so I can enrich my static so I have a real understanding or a guarantee that what I'm looking at is what I think it is.

28:07.520 --> 28:12.600
Because if I try to do it all statically, you know, there's a lot of question marks in my variable names.

28:12.840 --> 28:15.520
Well, you can see on SuperDiceCode they have eight what?

28:15.560 --> 28:19.080
Like they have 16 password, eight what?

28:20.620 --> 28:25.400
There are so many times I just call something like underscore maybe or underscore maybe not.

28:27.600 --> 28:29.180
Offset eight thing.

28:31.280 --> 28:34.700
I'm pretty sure I saw LOL go down in a comment somewhere.

28:36.060 --> 28:36.860
Oh, here we go.

28:36.860 --> 28:37.980
Double free detected.

28:37.980 --> 28:38.440
All right.

28:38.440 --> 28:39.820
So they have double free.

28:40.260 --> 28:43.120
Need to figure out how to bypass that check.

28:45.790 --> 28:49.470
And I think you can almost feel it in the pace that they're going.

28:49.470 --> 28:51.710
They feel like they're on to something.

28:51.710 --> 28:53.110
They feel like they're close.

28:54.210 --> 28:57.810
See the TCache chain there.

28:57.810 --> 28:58.770
Comprex negative...

28:59.510 --> 29:00.750
That was an impact.

29:02.170 --> 29:03.370
That's an instruction.

29:03.370 --> 29:03.770
Okay.

29:03.770 --> 29:04.610
I don't know though.

29:04.610 --> 29:05.850
I didn't write it.

29:05.990 --> 29:07.050
I was in read.

29:09.330 --> 29:10.990
That would explain it.

29:12.050 --> 29:14.990
I did not in fact write libc.

29:15.210 --> 29:16.690
Believe it or not, I did not do that.

29:16.690 --> 29:17.750
You're not the author.

29:17.750 --> 29:18.350
No, sorry.

29:18.350 --> 29:19.630
I'm not John libc.

29:19.630 --> 29:21.610
We'll have to see if we can get them on next time.

29:21.610 --> 29:22.190
Yeah.

29:26.920 --> 29:28.420
So they're definitely...

29:28.420 --> 29:30.740
Oh, so it looks like over on HypeBoy.

29:30.740 --> 29:32.040
HypeBoy.

29:32.060 --> 29:42.140
They have just kind of highlighted Realloc as a point of interest, which may or may not be a point of interest, but they're breaking on it.

29:43.300 --> 29:44.760
There we go.

29:46.220 --> 29:54.140
So for Realloc, when you're looking at a Realloc in the context of a challenge like this, what specifically are you looking for?

29:55.540 --> 29:58.500
I mean, Realloc is such a specific thing.

29:58.500 --> 30:01.860
Going through it, it's usually totally fine.

30:01.860 --> 30:13.320
If someone calculates a size wrong, or they increment a list size, like size T, and then Realloc for it, and you have a leak at the end of it.

30:13.320 --> 30:16.620
You know, just basic things like that, where you kind of do things out of order.

30:17.540 --> 30:22.000
Also, if you pass zero to Realloc, fun fact, it's free.

30:22.080 --> 30:24.060
That's what I was going to highlight.

30:24.060 --> 30:24.700
Yeah.

30:24.960 --> 30:27.980
So that might be relevant.

30:27.980 --> 30:29.000
Yep.

30:31.020 --> 30:42.140
Realloc is always relevant if you can get a mismatch between the size value going into Realloc and the size of the field as the object itself, or how it's being interacted with.

30:42.160 --> 30:46.940
But also, if you can get that value to be zero somehow, Realloc becomes a free.

30:46.940 --> 30:51.540
And I am guessing that that's the case.

30:51.540 --> 30:55.540
You have to be real careful as a C author with that.

30:55.540 --> 30:56.440
Oh, yeah.

30:56.460 --> 30:57.620
You got to be real careful.

30:57.620 --> 31:00.520
Otherwise, you know, you might end up with tcache double free.

31:00.520 --> 31:02.280
And , you know, no one wants that.

31:02.580 --> 31:04.020
Especially these players.

31:04.720 --> 31:06.380
Oh, I think that they do want it.

31:06.380 --> 31:07.380
Oh, nah.

31:07.840 --> 31:09.440
That's not how the program's supposed to work.

31:09.440 --> 31:12.040
This is a nice little family run shop program.

31:12.280 --> 31:15.420
And they're just in here just destroying the heap.

31:17.920 --> 31:20.100
And I think I saw some...

31:20.800 --> 31:23.440
But yeah, I mean, nice shot.

31:23.440 --> 31:26.820
But I think I saw some eggs in there, and I'm just waiting for the shellcode to come out.

31:26.820 --> 31:28.700
Oh, wait, they're adding eggs?

31:29.280 --> 31:32.000
No, one of the items in the shop.

31:32.000 --> 31:33.460
Oh, shell, geez.

31:33.520 --> 31:34.100
Yep, I win.

31:34.100 --> 31:38.340
Yeah, I'm so like trying to figure out, you know, where they are in this.

31:38.340 --> 31:42.880
Because it is part of the solution to put eggs in your cards.

31:43.700 --> 31:46.860
Look, we're simple people here.

31:47.080 --> 31:49.480
We enjoy our dad jokes.

31:50.160 --> 31:52.000
You know, the in jokes in the CTF community.

31:52.000 --> 31:53.920
Oh, I saw somebody looking at the rules page.

31:53.920 --> 31:54.220
Oh, wait.

31:54.220 --> 31:56.800
Oh, they're connecting to a remote instance.

31:57.340 --> 31:59.980
Oh, they got a shell.

32:00.560 --> 32:02.360
Oh, we might be looking at...

32:02.360 --> 32:02.820
At Hypeboy.

32:02.820 --> 32:04.040
Yeah, Hypeboy got a shell.

32:04.040 --> 32:04.880
They submitted.

32:04.960 --> 32:05.980
Hypeboy won.

32:06.820 --> 32:07.500
Oh my goodness.

32:07.500 --> 32:08.320
Hypeboy wins.

32:08.340 --> 32:10.220
And they have a cute cat in their taskbar.

32:10.700 --> 32:11.520
Congratulations, Hypeboy.

32:11.520 --> 32:12.100
Well done.

32:12.200 --> 32:12.880
Well done.

32:12.880 --> 32:13.880
How long was that match?

32:13.880 --> 32:14.080
Did we...

32:14.080 --> 32:17.200
Oh, unknown.

32:17.220 --> 32:17.720
Unknown.

32:17.720 --> 32:18.540
It was a match.

32:18.540 --> 32:20.120
Oh, and they already turned off the stream.

32:20.180 --> 32:20.780
They're done.

32:21.120 --> 32:22.700
So they're over there shaking hands.

32:22.700 --> 32:24.880
Everyone's been fantastic sports.

32:24.880 --> 32:28.720
You know, it's been all smiles.

32:28.720 --> 32:30.680
No one's salty about this.

32:30.680 --> 32:31.920
It's a fun competition.

32:31.920 --> 32:33.400
People respect each other here.

32:33.400 --> 32:35.540
Everyone knows you've earned your place here.

32:35.700 --> 32:39.100
Yeah, I think I've seen disappointment.

32:39.100 --> 32:39.780
Sure.

32:39.880 --> 32:42.720
But I, you know, shaking hands.

32:43.240 --> 32:45.220
I think everybody respects each other.

32:45.220 --> 32:48.580
Everybody knows that if you're here, you have made it.

32:48.580 --> 32:53.820
And these challenges are hard for no other reason than just the environment that it's in.

32:53.820 --> 32:58.380
All of these players have already been playing in, you know, the Olympics of hacking.

32:58.420 --> 33:04.780
So to come and play this sprint on the side of it, in the middle of a marathon, if you will.

33:06.400 --> 33:08.520
Well, that was another match from us.

33:08.520 --> 33:10.100
It was a pleasure casting with you.

33:10.100 --> 33:10.460
Yep.

33:10.460 --> 33:11.420
I'm glad they solved it.

33:11.420 --> 33:12.740
Great working with you, Josh.

33:13.320 --> 33:14.960
And good job on the challenge.

33:14.960 --> 33:18.940
I think that was appropriately difficult.

33:19.100 --> 33:22.520
It was tense there for a bit, but I'm glad that we got to see a solve.

33:22.520 --> 33:25.160
That was my nicest challenge.

33:25.160 --> 33:26.700
The other ones are mean.

33:26.980 --> 33:29.260
So we'll see how those go later.

33:30.460 --> 33:33.060
But it's been fun casting.

33:33.060 --> 33:33.940
It was a good match.

33:33.940 --> 33:35.160
Thank y'all for joining.

33:35.200 --> 33:38.540
And we'll be back with another match shortly.

33:38.540 --> 33:39.180
Yep.

33:39.320 --> 33:39.980
See you soon.

33:39.980 --> 33:40.580
Take care.

