WEBVTT

00:12.320 --> 00:18.240
Welcome back to the second day of live CTF here at the DEF CON CTF finals.

00:18.700 --> 00:21.400
I'm Zita2 and I'm here with Mark.

00:21.400 --> 00:22.200
Mark Griffin here.

00:22.200 --> 00:24.000
Yep, so we're jumping back into it.

00:24.000 --> 00:25.560
Same format as we've been doing.

00:25.560 --> 00:27.120
Excited to see this challenge.

00:27.120 --> 00:28.460
Yeah, this is going to be great.

00:28.460 --> 00:32.500
I think let's not keep this for long.

00:32.500 --> 00:39.440
Let's get the game started and then we can talk more once they have started looking at the challenge.

00:39.440 --> 00:41.460
So I'm just going to get a final confirmation from production.

00:41.460 --> 00:42.280
We have that.

00:42.280 --> 00:51.760
So we're going to start the second round of the second day in 5, 4, 3, 2, 1, go.

00:51.760 --> 00:52.960
All right.

00:52.960 --> 00:54.460
Let's jump over and see.

00:54.460 --> 00:58.400
Yep, let me just find this.

00:58.400 --> 01:04.180
So we have the teams participating in this match that we're casting.

01:04.960 --> 01:08.660
Shellfish versus TWN48.

01:10.540 --> 01:16.520
Yeah, this is in the lower bracket of the tournament.

01:16.640 --> 01:21.640
So whoever loses this match is unfortunately eliminated from the tournament.

01:21.860 --> 01:25.100
Yeah, there's definitely a lot on the line.

01:25.100 --> 01:30.600
But with the double elimination bracket, they also have the chance to go all the way back up and win the whole thing.

01:30.600 --> 01:31.280
Right.

01:31.280 --> 01:40.300
So maybe they just had a bit of a rusty start yesterday and now they will just go all the way back to the top.

01:40.460 --> 01:45.160
And we can see we've got Shellfish over here already digging into the code.

01:45.160 --> 01:46.660
It's a Python challenge.

01:47.300 --> 01:50.540
And so they've got the whole challenge right in front of them.

01:50.540 --> 01:51.700
They can read the code.

01:51.700 --> 01:53.760
They just have to figure out what to do.

01:54.020 --> 01:56.280
And so I think we saw a prompt already.

01:56.420 --> 02:01.720
And this is an interesting problem.

02:01.720 --> 02:05.220
I wanted to do a riff on a standard Python jail.

02:05.220 --> 02:15.200
So Python jail problems are, hey, we're going to establish some sort of constraint that makes it hard to do arbitrary things from within the jail.

02:15.280 --> 02:20.960
Instead, this one is more of a, it looks kind of like a jail, but it's actually a bytecode problem.

02:20.980 --> 02:21.400
Right.

02:21.400 --> 02:29.740
So roughly they have to provide some Python code that goes through a filter.

02:31.280 --> 02:43.980
But then after the filter, they are allowed to swap out the bytecode, which is part of the whole code object.

02:43.980 --> 02:46.180
So they can basically modify the code object.

02:46.180 --> 02:58.780
And this way they can then change the code from doing something that passes the check, supposedly something benign, into something malicious that will get them there.

02:58.780 --> 02:59.380
Yeah.

02:59.380 --> 03:02.160
And so there's not a ton of code in this.

03:02.160 --> 03:06.600
There's enough that it's, you know, they've got to take a little bit of time and read through it.

03:06.600 --> 03:17.880
There's some stuff that sounds like it's debug related, which does kind of mirror real world problems where developers leave in some extra debug functionality.

03:17.880 --> 03:21.700
They didn't intend it to go into production and can be leveraged.

03:21.700 --> 03:22.020
Yeah.

03:22.020 --> 03:25.020
So a little bit of...

03:25.020 --> 03:29.160
So I was attempting to try to solve this challenge.

03:29.160 --> 03:33.700
I also noticed that, well, we don't have the camera on, but our banner is falling down behind us.

03:33.700 --> 03:34.860
But that's fine.

03:36.040 --> 03:37.460
We're overcoming today.

03:37.460 --> 03:37.920
Yeah.

03:38.980 --> 03:51.000
No, but what I was going to say that, yeah, there is like a bunch of stuff in the code, almost like, you know, decoy code or like stuff that's not quite relevant.

03:51.000 --> 03:58.060
Which I think it's, we kind of balanced this a little bit by most of the challenges we have are like compiled machine code.

03:58.640 --> 04:05.680
But very, very minimal, like pretty much all the code in the challenges are relevant to the solution.

04:05.680 --> 04:07.480
In this case, it's Python.

04:07.480 --> 04:09.540
So it's like by default, more readable.

04:09.580 --> 04:13.420
But then there's a little bit more stuff there that you don't actually care about.

04:13.420 --> 04:13.680
Yeah.

04:13.680 --> 04:17.200
And it's just trying to toe that line, right?

04:17.200 --> 04:26.280
Get it so it's not going to be solved in like five minutes, but it's not too hard that you can separate the chaff from what actually matters here.

04:26.280 --> 04:37.760
And we've already seen the competitors looking at that, the code module, which allows you to build these Python objects, which is ultimately what we're going to see modified.

04:37.760 --> 04:38.000
Right.

04:38.000 --> 04:45.120
And if we switch over to Shellfish here, you can see that they are playing around, having a more dynamic approach.

04:45.120 --> 04:47.680
You know, trying various inputs.

04:47.680 --> 04:52.000
You saw that they were running the program with various inputs.

04:52.000 --> 04:57.560
You see like the answer is they are looking at what different objects are available.

04:57.700 --> 05:04.200
This looks to me a little bit like the approach you would take if you were to the jail challenge.

05:04.200 --> 05:07.260
You're looking at like what various attributes.

05:07.260 --> 05:21.060
In Python, there's a lot of like reflection and like various ways to access, you know, like parent objects and global kind of meta objects and stuff like this.

05:21.220 --> 05:21.960
Exactly.

05:21.960 --> 05:30.760
And, you know, with a problem like this, I certainly expected that maybe they could come up with something that I didn't expect and they'd bypass the check and win that way.

05:30.760 --> 05:32.640
I'm not open to anything here.

05:32.680 --> 05:44.640
These competitors, not only have they seen and studied Python jail problems from the past, but they may even have stuff in their back pocket that is non-public, you know, bypass type stuff that could come into play here.

05:44.640 --> 05:45.900
Yeah, definitely.

05:45.900 --> 05:55.080
I mean, it would not be the first time we saw, you know, zero days and so on at the DEF CON CTF.

05:55.080 --> 05:57.600
So, yeah.

05:57.860 --> 06:06.260
Let's switch back over to TWN and you can see them like going around in the code.

06:06.260 --> 06:12.380
I feel like they are taking a more static analysis approach to the problem.

06:12.380 --> 06:17.820
And they're also, though, because this is a Python problem, it's very easy to modify.

06:17.820 --> 06:26.740
And I think I've seen both players do something along these lines, but certainly TWN48, they're changing the code at least to make it more readable.

06:26.740 --> 06:38.160
But they're also thinking, hey, I can just skip this or add an extra print here, changing the challenge a little bit so that they can understand what they've got to deal with.

06:38.160 --> 06:41.900
And you can see the comment there, cannot call built-in and function.

06:42.860 --> 06:52.060
So they're like, you know, kind of like figuring out the implications of the constraints that are given in this problem.

06:52.400 --> 06:56.760
Also, like looking here, cannot use DEF and class.

06:56.980 --> 07:02.360
So they're like, you know, just trying to figure out what the playing field is here.

07:02.360 --> 07:07.080
Yeah, and both competitors immediately trying to find the bounds of what they can do.

07:07.080 --> 07:08.700
I think that's a great approach.

07:09.100 --> 07:16.340
It is kind of interesting to see what the limits are, because the limit is done at that bytecode level.

07:16.660 --> 07:19.760
So they may not be used to seeing that.

07:19.760 --> 07:22.360
I know that writing this challenge, it was interesting to see.

07:22.360 --> 07:28.920
I was checking a lot of different things that competitors might do and making sure that the filter was sort of going to stop those things.

07:28.920 --> 07:29.940
Right.

07:29.940 --> 07:38.540
We saw there that CWM, they were trying to define a lambda function, but they were having some problems with that.

07:38.540 --> 07:42.420
So, you know, we'll see how that turns out.

07:43.060 --> 07:48.720
If we can switch over to Shellfish here, I see them highlighting some of these functions.

07:48.720 --> 07:54.100
This is really some keyword checking is what's going on here.

07:54.100 --> 07:56.840
And you can see that there's some different if conditions here.

07:56.840 --> 08:01.540
I see that they've highlighted AI log text, which looks like it's logging.

08:02.100 --> 08:07.620
There's also another function you can see sort of sandwiched in between those that's different AI log code.

08:07.620 --> 08:13.900
And that's really the it's a little bit of an innocuous sounding function, but really what they're going to be most interested in.

08:13.900 --> 08:14.560
Right.

08:14.760 --> 08:15.080
Yeah.

08:15.080 --> 08:28.260
So I think a lot of the, as we kind of mentioned, like a lot of the initial work here will be focused on trying to like separate, you know, what are we actually interested in here?

08:28.260 --> 08:32.600
Like which part of this code actually is relevant?

08:32.600 --> 08:43.260
Yeah, and this is this is actually a problem that I've been very fascinated about recently, which is when you're looking at a whole file full of Python, how do you understand how these functions relate to each other?

08:43.260 --> 08:44.980
How do you understand the overall whole?

08:45.140 --> 08:50.020
I actually feel like the linear view, actually reading the code is a pretty inefficient way to do it.

08:50.020 --> 08:55.260
If you could see all of the functions sort of arranged, I feel like it would give you a big advantage in this case.

08:55.260 --> 08:56.040
Right.

08:56.520 --> 09:11.620
That's, you know, get some kind of flow view, some flow visualization, like a call graph and, you know, something like this to help you understand the flow that these things are going through.

09:11.620 --> 09:17.620
Yeah, because in this case, there's really one core module here that that is being used for that bytecode manipulation.

09:17.620 --> 09:22.460
And so obviously anything related to that module is going to be very interesting to the compiler.

09:22.460 --> 09:28.100
And speaking of that module, we can switch over to TWN again.

09:28.100 --> 09:36.160
I saw, let's see if it comes up again, but it looked like they were looking into the documentation around the code module.

09:36.160 --> 09:42.460
And, oh, it seems like...

09:42.460 --> 09:50.220
It looks like they're trying to figure out what keywords do I need to put in to get to the different functions there.

09:50.220 --> 09:52.760
And so they were looking at AI log code, I think.

09:54.920 --> 09:59.060
And they're adding print statements again to make it easier for them to debug.

09:59.060 --> 10:01.400
Hey, how do I get to this spot?

10:01.400 --> 10:14.220
And I think, yep, you can see that they're enumerating what each of these words as they relate to a bit field, they're sort of like binary flags packed.

10:14.620 --> 10:18.320
And they're seeing that this is a function of interest.

10:18.360 --> 10:23.220
And I think we're on the right track here to see them explore this.

10:23.220 --> 10:34.100
So it was cool to see how they went from testing the bounds of the Python jail to enumerating what these keyword functions were.

10:34.320 --> 10:34.400
Yeah .

10:34.400 --> 10:49.940
And maybe start trying to figure out how they can circumvent these things or what things they are going to need to care about more here.

10:49.940 --> 10:57.340
So this AI log code function, what is it doing?

10:57.340 --> 11:06.760
Yeah, so really you can see the argument input obj is the same code object that they put in earlier.

11:06.760 --> 11:09.060
And so it has to pass a filter check.

11:09.060 --> 11:22.900
But then you can see, if you get a good look at the code again, it also allows the user to, so that defend the eggs prompt is saying, hey, take in some more input here and then we're going to do something with it.

11:22.900 --> 11:26.020
And it looks like they're exploring exactly what they can do with it here.

11:26.340 --> 11:29.120
But it's going to modify that code object.

11:29.120 --> 11:40.900
And so that really the path to exploitation here is to understand that you have to set up an object that has the pieces that you want in order to run your payload.

11:40.900 --> 11:43.400
But it still needs to bypass that filter.

11:43.400 --> 11:45.860
That's very nice.

11:45.860 --> 11:54.680
And I think we just saw here that they just tried inputting this hex string here.

11:54.680 --> 12:00.400
They just took like the string hello and sent it as this additional input.

12:00.400 --> 12:02.860
So now we have like a Python crash.

12:03.880 --> 12:07.540
Right, because it's raw bytecode is what is being selected.

12:07.540 --> 12:10.340
So it's platform specific, interpreter specific.

12:11.180 --> 12:18.680
I expect that they will quickly move from trying to put raw hex into it to getting some sort of bytecode production.

12:19.340 --> 12:27.020
And this is a little bit of a challenge when it comes to solving this, right?

12:27.020 --> 12:32.820
Because they need to kind of match the version running on the server, right?

12:32.880 --> 12:34.240
For the Python.

12:34.240 --> 12:34.800
That's right.

12:34.800 --> 12:37.600
I believe there's a comment in the code that says what it was tested on.

12:37.600 --> 12:39.440
And they can verify that.

12:40.900 --> 12:43.940
Yeah, I think it will print out the version.

12:43.940 --> 12:50.740
So if they connect to the, if I remember correctly, like if you connect to the server, it will print out the version as well, right?

12:50.740 --> 12:52.960
You can also query using this.

12:52.960 --> 12:55.360
Right, since you can execute code.

12:55.360 --> 12:55.760
Right.

12:55.760 --> 12:56.140
Yeah.

12:56.700 --> 13:02.960
That was the way we made it so that they can use the remote servers to get the rights.

13:02.960 --> 13:16.920
And I want to go over back to TWN because I saw that they had a, you know, here they're like printing the, like they have the disassembly of the bytecode.

13:16.920 --> 13:19.920
So you can see there's a load constant and return value.

13:20.340 --> 13:20.780
Right.

13:21.180 --> 13:23.920
There's a hidden debug function that allows them.

13:23.920 --> 13:26.140
And so, again, this is trying to point them in the right direction.

13:26.140 --> 13:37.300
Hey, we'll show you this object, give you an idea of what's in it, which should help you understand how to solve it, which is, you know, modifying that bytecode as we talked about.

13:37.300 --> 13:37.760
Right.

13:37.760 --> 13:44.520
And maybe just, you know, to kind of explain this for people who might not be like too familiar with Python.

13:44.520 --> 14:11.040
So like the Python programming language, you have like a bunch of different implementations of this with the kind of standard one that most people use is CPython, which when it executes Python code, it will take the human readable text code, do all the parsing and so on and compile this into an internal bytecode format.

14:11.040 --> 14:15.240
And then it will execute that within its virtual machine.

14:15.500 --> 14:15.620
Right .

14:15.620 --> 14:30.420
So they are allowed to modify like not the text code that they send in, but like the bytecode that the interpreter has produced after, you know, parsing and so on the code.

14:30.420 --> 14:31.040
That's right.

14:31.040 --> 14:34.420
It's almost the lower level language.

14:34.420 --> 14:54.960
So you're typing the text, your print hello world that we're seeing, but really what they're going to want to do here is they're going to want to take the code that they want to run at that high level language and then get the bytecode that does the equivalent and then stuff that into the code object that they're able to modify.

14:56.560 --> 14:57.300
Yep.

14:57.440 --> 15:03.500
And let's see if we can see what's going on here with TWN48.

15:03.500 --> 15:07.460
They're looking at the filter again.

15:07.600 --> 15:11.080
They've got the debug output going on.

15:11.080 --> 15:15.840
So they're starting to think about, okay, what is really possible here?

15:15.840 --> 15:30.540
I'm not sure that I've seen them look and see if they've found the code modification bit, but that is the first hint that we tell them that it's perhaps not the problem that it first appears to be.

15:30.540 --> 15:31.780
It's not a Python GL problem.

15:31.780 --> 15:33.220
It's more of a patching problem.

15:33.220 --> 15:34.160
Right.

15:34.160 --> 15:44.760
So at this stage, I would say that Shellfish might be just a little bit ahead in the progress.

15:45.600 --> 15:56.920
And let's switch over to them and see that they are, in fact, I think you could see it there very briefly, but they were compiling some code there in the script.

15:57.710 --> 16:00.920
So they have this test script.

16:00.920 --> 16:02.040
You can see there.

16:02.040 --> 16:06.180
So they have these two calls to compile command.

16:06.640 --> 16:09.600
And they have two different code inputs.

16:09.600 --> 16:13.080
I think this is very much along the right line.

16:13.080 --> 16:27.740
They are trying to, well, if I would guess, they might be trying to produce two different text inputs, which result in maybe the same byte code or different byte code.

16:27.740 --> 16:35.600
And they're trying to see how changing the text of the code changes the compiled result of that.

16:35.600 --> 16:35.840
Exactly.

16:35.840 --> 16:40.680
You can see that they've got this fn.replace.co.code.

16:40.680 --> 16:43.240
That's exactly the construct that they've got in the challenge.

16:43.240 --> 16:43.260
Right.

16:43.260 --> 16:50.760
So they have basically taken the whole big program and they have distilled it down to the core thing that's going on here.

16:50.760 --> 16:57.120
And then moved that out into a small test environment, which is excellent.

16:57.120 --> 16:58.320
Great approach.

16:58.320 --> 17:08.800
And you can see in that other terminal window there, you can see the byte code, that load name, load const, very simple operations there.

17:08.800 --> 17:13.740
But it also is going to refer to these strings, for example.

17:13.740 --> 17:15.100
The strings aren't in the byte code.

17:15.100 --> 17:16.200
They're being referenced.

17:16.280 --> 17:22.280
And so what they're determining now is how do I end up with the things that I want to have happen?

17:23.060 --> 17:24.920
The references have to line up.

17:24.920 --> 17:25.420
Right.

17:25.540 --> 17:30.060
And I think you can see that they're printing out these various attributes of the code object.

17:30.120 --> 17:36.920
So if I were to take a guess, they realize that they can only change those...

17:37.500 --> 17:38.120
The byte code.

17:38.120 --> 17:38.900
The byte code.

17:38.900 --> 17:41.300
So they need to make sure that all the other things agree.

17:41.300 --> 17:42.020
Exactly.

17:42.020 --> 17:56.160
But if we go back to TWN, we can see here that they're also looking at the documentation for the compile command function and doing some...

17:56.800 --> 17:59.420
Yeah, looks like they're looking right at it.

18:14.440 --> 18:15.200
Yeah.

18:16.660 --> 18:17.540
And it's funny.

18:17.540 --> 18:23.060
If you look at the documentation for this, a lot of the documentation is kind of like, don't poke around with this.

18:23.060 --> 18:25.600
It's negative and you should be using other stuff.

18:25.600 --> 18:25.980
Yeah.

18:25.980 --> 18:30.600
But here we're a competition for hackers and that's what we're asking them to do.

18:30.600 --> 18:30.960
Right.

18:30.960 --> 18:40.540
And you can see here they were copying the system command and trying to...

18:40.540 --> 18:44.500
They have here a piece of code that they want to run.

18:44.500 --> 18:46.920
So this is kind of the goal, I think.

18:46.920 --> 18:56.860
But now I guess they're trying to get... this looks like they were trying to figure out the byte code of this.

18:56.860 --> 19:03.500
So what they probably kind of missed there is that they need to compile that code into code object and then get the code attributes.

19:03.640 --> 19:12.460
Yeah, they're definitely in the phase of understanding the primitives that they have, the code module itself, and what they can do with it.

19:12.460 --> 19:13.000
Right.

19:13.000 --> 19:17.080
And I want to switch back over to Shellfish because you can see here now there's some progress on their script here.

19:17.080 --> 19:18.960
You can see the two pieces of code.

19:18.960 --> 19:24.600
They have print high and import OS and now comparing these two things.

19:24.860 --> 19:32.000
And what I think is an important thing that they will want to look at is this list of constants.

19:32.000 --> 19:42.100
The CO constants there, you can see there is a high in one of them and... OK, no, they're only printing one object, so it's high in all of them.

19:42.820 --> 19:46.880
So, yeah, definitely look like some progress there.

19:46.880 --> 19:55.460
But then that's exactly the approach, though, is they're looking at, hey, I've got two objects and I understand I can only change one of these other things.

19:55.460 --> 20:00.500
What do these other parts need to be so that when I do make the swap, it'll all work?

20:00.500 --> 20:01.160
Right.

20:01.460 --> 20:05.100
I feel like they're making great progress and they're on the right track.

20:05.660 --> 20:06.420
Yep.

20:06.620 --> 20:13.140
And they're here again looking at just a little bit of documentation for the compile command function.

20:13.220 --> 20:16.000
Yeah, this is actually a key detail here.

20:16.120 --> 20:29.020
That compile command, the third argument there, the eval argument, controls how the input is going to be parsed, whether it's a single expression, whether you can do multiple expressions, a whole block of code like a module.

20:29.020 --> 20:29.460
Right.

20:29.460 --> 20:46.980
And this explains why, so it's set to eval, which is a single expression, which explains why earlier when TWN were trying to define their lambda function, because an assignment in Python is not an expression, it's a statement.

20:46.980 --> 20:50.680
So you cannot have that in an eval context.

20:50.680 --> 21:09.000
However, with the new walrus operator that was, well, relatively recently introduced in Python, you can have an assignment as a statement.

21:09.960 --> 21:20.660
I actually wrote a little bit of a blog post about this, how this enables you to write certain types of these Python payloads more easily with this.

21:20.660 --> 21:28.300
Yeah, so if they would have changed the code that they had, it was like A equals lambda something something.

21:28.300 --> 21:34.200
If they would have just added a colon to the assignment thing there, that would have worked fine.

21:34.280 --> 21:38.800
They would still not have been able to call that function, but they could have defined it, right?

21:38.800 --> 21:40.980
Right, and that's exactly what I was talking about.

21:40.980 --> 21:45.440
When you've got competitors at this level, I totally expect stuff like that.

21:45.440 --> 21:49.680
The walrus operator was not something I was thinking about when I was writing this challenge.

21:49.680 --> 21:51.860
But it's modern, right?

21:51.860 --> 21:55.640
Python 3.10, we've got some extra tools in the toolkit.

21:55.640 --> 22:01.820
Right, and if we do switch over to TWN, we see that they are looking at these code objects.

22:01.940 --> 22:06.840
You can see that they did compile a piece of code, and they were looking at what different attributes.

22:07.000 --> 22:12.080
And now googling again about the code attributes.

22:12.280 --> 22:18.700
Yeah, and that co underscore code, that is the key to zero in on here, so I'm glad that we've got both competitors looking at that.

22:19.400 --> 22:21.540
And that's just the byte code.

22:22.040 --> 22:22.720
Right.

22:22.720 --> 22:24.260
As we've talked about.

22:24.260 --> 22:24.880
Yeah.

22:24.880 --> 22:28.720
So the larger code object has these other pieces.

22:29.200 --> 22:33.760
I think that they've both realized they have the ability to modify that co underscore code.

22:34.440 --> 22:39.400
So at this point, it's off to the races who can figure out exactly how to use that to gain execution.

22:39.400 --> 22:50.320
Yeah, and I feel like, even though I still think Shellfish is a little bit ahead, I feel the gap has become smaller.

22:50.320 --> 22:50.680
Definitely .

22:51.100 --> 23:03.720
Because TWN is definitely in the right area here, looking at these, compiling this code, looking at how it behaves in various contexts like exec here.

23:03.740 --> 23:09.720
So yeah, it's definitely still very much an open game.

23:09.720 --> 23:15.800
Yeah, I think that we see this in all sorts of challenges where one competitor will find something.

23:15.800 --> 23:18.220
That's the insight that they need.

23:18.220 --> 23:20.240
They'll sprint ahead to the next roadblock.

23:20.240 --> 23:22.860
And then it's really, it's not over.

23:22.860 --> 23:29.320
They get a temporary advantage, but then the other competitor can bust through that insight and then maybe overtake them really quickly.

23:29.320 --> 23:30.360
It stops and starts.

23:30.360 --> 23:31.240
Absolutely.

23:33.100 --> 23:45.400
Looking here at Shellfish again, you can see now that they have the thing they want to do down there.

23:45.400 --> 23:54.440
There was an interesting approach where they make use of a second layer of evaluation.

23:54.440 --> 24:09.160
So it seems like their goal is to just take the thing they want to execute, put it in a string, and then in their initial code just print that string, but then in their second code do eval on that string again.

24:09.160 --> 24:09.960
That's right.

24:09.960 --> 24:11.980
I really like this approach.

24:11.980 --> 24:26.100
And whenever we see somebody jumping back to the rule page there when they're close to the end, we are watching out because that shows them exactly what they need to run to win the challenge.

24:26.100 --> 24:27.340
It looks like they're very close.

24:27.340 --> 24:30.340
They've got the sort of secret keyword there, which is omelet.

24:30.340 --> 24:33.940
Again, I don't think that's the first time we've seen reference to eggs and shells.

24:34.100 --> 24:36.620
So Python shellcode kind of challenge here.

24:36.620 --> 24:43.900
I think they were going back to the info page because we released the hint there.

24:43.900 --> 24:49.100
So you can see the hint that said this is not a jail problem, it's a patching problem.

24:49.100 --> 24:52.840
These competitors both see what the problem is.

24:53.880 --> 24:56.280
I think we're pretty close here.

25:01.960 --> 25:05.800
It's going to be really cool to see there if they can get this going.

25:05.800 --> 25:09.620
They seem like they're making some small changes to the exact code they want to run.

25:09.620 --> 25:13.880
Yeah, try and subprocess instead of OS system.

25:14.000 --> 25:14.480
Right .

25:14.660 --> 25:20.960
And you can see here they are going straight for running the submitter binary instead of popping a shell.

25:20.960 --> 25:31.660
So that's a good opportunity to talk about how the goal of this challenge is to solve the challenge and it will always end in you getting code execution on the server.

25:31.660 --> 25:38.660
And then on the server you have a small binary called submitter which you need to run to kind of prove that you have code execution.

25:38.700 --> 25:44.240
So most of the times you usually just go for like popping a shell and then you manually run that binary.

25:44.240 --> 25:48.740
But here you're baking in the submitter run straight into the code.

25:49.140 --> 25:50.040
That's right, yeah.

25:50.040 --> 25:54.260
And the reference solution that I wrote was more of the shell approach.

25:54.260 --> 26:03.020
But I can see that just looking to iterate, get that submitter run, feels it is close.

26:03.060 --> 26:03.680
Yep .

26:07.060 --> 26:19.340
And over on the TWM side, we have again some more progress around investigating these code objects, compiling stuff, printing these objects, trying to like...

26:19.340 --> 26:28.180
It seems like this person is not that familiar, so they're trying to just understand how these things work.

26:28.460 --> 26:33.300
What are these attributes and how do they interact with each other?

26:33.300 --> 26:36.520
Right, looking at that eval, understanding exactly how it works.

26:36.520 --> 26:42.620
So I'm dropping the keyword omelette in there and trying to understand, okay, what does this need to be?

26:42.620 --> 26:45.700
Is this going to cause problems if I need to have it in there?

26:45.700 --> 26:50.500
But yeah, zeroed in on the ALogCode function so that they know they need to get in there.

26:50.500 --> 26:53.780
It's just a question of what's the next step.

26:53.780 --> 26:58.120
I actually want to go back again to Shellfish because I saw some really interesting progress here.

26:58.120 --> 27:03.200
You can see they compiled the code, they're inputting this, and they win.

27:03.840 --> 27:04.880
I think they ran it.

27:04.880 --> 27:05.220
They win.

27:05.220 --> 27:07.220
I think they dropped the hex bytecode in there.

27:07.220 --> 27:09.360
Do we have the confirmation?

27:09.580 --> 27:10.760
Yep, Shellfish won.

27:10.820 --> 27:11.820
Shellfish takes it.

27:11.820 --> 27:13.840
So very, very good job.

27:14.040 --> 27:16.280
Let's switch over here.

27:16.380 --> 27:21.640
It went from they kind of had it and then suddenly they won.

27:21.640 --> 27:23.840
So that's really, really cool to see.

27:23.840 --> 27:25.000
Great job.

27:25.640 --> 27:30.000
Congratulations, Shellfish, advancing to the next round.

27:30.000 --> 27:34.700
Unfortunately, that means goodbye to TWM.

27:34.700 --> 27:37.040
Yeah, best of luck to them in the rest of the finals.

27:37.040 --> 27:39.440
But this was really a great challenge to see.

27:39.440 --> 27:42.080
Both competitors start moving down the right track.

27:42.080 --> 27:45.240
Really, I feel like they kept up their lead.

27:45.380 --> 27:53.160
But this was actually one of the problems that I think we thought internally was potentially a harder one that might have gone the distance.

27:53.160 --> 27:53.840
Oh, absolutely.

27:53.840 --> 27:58.900
I think because it's like, you know, maybe not something you're not quite as familiar with.

27:59.040 --> 28:02.320
So, yeah, definitely...

28:04.080 --> 28:05.980
Yeah, could have been definitely a challenge.

28:05.980 --> 28:06.780
Could be stuck.

28:06.780 --> 28:08.240
To be fair, we do have...

28:08.240 --> 28:14.520
So in this tournament, this is a good time to mention this, is that we are running two matches in parallel.

28:14.560 --> 28:14.900
Right.

28:14.900 --> 28:18.100
So we are commentating one of the matches.

28:18.380 --> 28:21.180
But then there's another match going on simultaneously.

28:21.180 --> 28:23.060
And that one has not finished yet.

28:23.080 --> 28:26.840
Yeah, and all of these competitors are from DEF CON finals teams.

28:26.840 --> 28:29.060
So everybody is top, top tier.

28:29.240 --> 28:35.120
We do give the teams a little bit of a heads up in that they know that this is a Python challenge coming in.

28:35.120 --> 28:40.260
So they're probably sending in their people who are the very best on their team at dealing with Python.

28:40.580 --> 28:42.460
Yeah, totally.

28:42.540 --> 28:47.520
And I mean, it's really, you know, the pressure, the stress of being there.

28:47.540 --> 28:50.020
Just you, no help from your team.

28:50.380 --> 28:53.240
You know that you're kind of like representing your whole team.

28:53.240 --> 28:55.980
And there's a bunch of points on the line for this.

28:56.140 --> 28:57.180
It adds up.

28:57.180 --> 28:57.440
Right.

28:57.440 --> 29:02.240
So definitely not an easy task to play these matches.

29:02.240 --> 29:03.440
Yeah, a lot of pressure.

29:03.440 --> 29:10.700
And again, you can't, it can't be understated or overstated how much the fatigue is going to set in.

29:10.700 --> 29:12.460
We're in day two of the finals.

29:12.460 --> 29:13.940
Tomorrow is going to be even tougher.

29:13.940 --> 29:14.500
Yep.

29:14.500 --> 29:19.960
And before we go to a break here, let's bring up the bracket.

29:20.340 --> 29:25.340
We do have, as we said there, Shellfish beating TWN.

29:25.340 --> 29:32.020
We still have the Orge crowd versus Pigbuttsad going on in the background.

29:33.020 --> 29:40.420
So, yeah, the winners of these two matches actually will face off in the next round, which will be coming up...

29:40.420 --> 29:41.360
Very shortly.

29:41.360 --> 29:42.300
Very shortly.

29:42.340 --> 29:46.380
So it's going to be exhausting for the players.

29:46.380 --> 29:47.920
Yeah, that's tough.

29:47.920 --> 29:54.840
But I think when we were putting the bracket together, it was, hey, somebody is going to have to play back to back to jam in all of these matches.

29:54.840 --> 29:56.420
That's just the way it's going to have to be.

29:56.420 --> 30:01.420
So I think that's it for now.

30:01.860 --> 30:03.300
It was a great match.

30:03.300 --> 30:08.240
Really cool to see these teams approaching this problem.

30:08.640 --> 30:11.020
And, yeah, we will go to a break.

30:11.020 --> 30:15.100
We will be back with the next match in a bit.

30:15.100 --> 30:20.420
You can check out, if you want to see the raw feed from the other match, we're just streaming the screens without any commentary.

30:20.420 --> 30:25.800
You can go to livectf.com and there will be links there to the YouTube channel and so on.

30:27.020 --> 30:30.520
But otherwise, yeah, we will be back in a bit.

30:30.840 --> 30:31.340
Yeah.

30:31.420 --> 30:32.620
Yeah, great match.

30:32.620 --> 30:34.120
Great commentating with you, Carl.

30:34.120 --> 30:35.020
Yeah, it was great.

30:35.020 --> 30:37.800
And I will be back for the next match.

30:38.000 --> 30:42.100
And, yeah, they will see you later.

30:42.100 --> 30:42.680
Yep.

30:42.720 --> 30:43.280
Great.

30:43.280 --> 30:43.840
Till then.

30:43.840 --> 30:44.400
Bye.

