start	end	text
11580	17440	And we're back. Live CTF here at DEF CON. And I'm Mark Griffin and I'm joined this time
17440	24060	by Josh from Vector35. Yeah, Josh aka Negasora on everything I'm on. And it's been fun working
24060	29040	on this. It's my first time on camera for it. I think, oh my gosh, maybe ever. You're
29040	32740	welcome. Yeah, thank you so much seasoned veteran like yourself. Yeah, right. My second
32740	37840	time. Yeah. No, but I've been working behind the scenes and just set up infrastructure
37840	43700	to be one script that works. So I think without further ado. Yeah, let's get into it. So again,
43700	47880	this is the third challenge. We got matches five and six. Bluewater versus Macaroni and
47880	53160	we'll be commenting Super Dice Code versus Hypoid. Yeah. So Bluewater, Macaroni, team
53160	60560	one versus team eight seated. And then Super Dice Code placed fourth and falls Hypoid 12th.
60560	64200	So I think these are going to be pretty good matches. There could be an upset here. I'm
64200	67800	excited to see it. So should we just get into it? All right. Yeah. Let's start the challenge
67800	78200	in five, four, three, two, one. Go. Go. And we're live. Let's watch. And I think we can
79640	86800	watch and get right into it. Oh, very nice. All right. So this is a challenge called Shop
86800	94380	that I wrote. Oh, God. Three months ago. Yeah. Let's go three months ago and not a month ago.
94380	99420	Super fresh in your mind. Super. Oh, it's real. You know, I still think about it. Never.
102080	107540	It's a simple one. I'm not going to lie. You know, it should be one of the faster matches,
107540	112120	but it should still be interesting to see the way they approach it because it is open ended
112120	117940	enough that there are there's more than just my intended solution. Yeah. And, you know, of course,
117940	122700	with the time pressure and the environment and these these folks have been working hard on the
122700	127540	DEF CON CTF final. So they're under a lot of pressure, a lot of mental fatigue already,
127540	133840	I'm guessing. So definitely even the easiest problems can become hard. Yeah, absolutely.
133920	138420	But we see Super Dice Code getting right into it, dropping it into IDA, starting to
138420	144720	starting to annotate, fill out the the names of everything so they can really figure out what's
144720	148740	going on. Now, interestingly, Hypeboi, instead of dropping it directly into a decompiler,
148740	153800	well, OK, as I say that, but they were just interacting with it. They just wanted to see
153800	158300	what the flow was before they even took a look at it, which honestly, that's usually my approach.
158300	162560	If I know it's not like malware in the CTF setting, I just run the thing and I'm like,
162560	166440	OK, it prints here. Let's step back from the first print and see if anything weird happens.
166440	170700	Then I continue forward. Yeah, you know, I find it's really interesting. There's really
171380	176220	a lot of different opinions on how to go about it. Some people like to go completely static until
176220	179980	they have an idea of what the bug is, and some people just want to jump in and start interacting
179980	186320	with it. The people that just look at a binary statically and get it, like just have a solution
186320	192400	from it. I don't know how they have the stack layout in their mind like that. I try to remember
192400	198600	and it pulls a memory overflow. Yeah, some of my good friends. But yeah, me, I love dynamic
198600	204060	analysis. I want to see it in the debugger. That's how I operate. And I think I already
204060	209480	see a debugger popping open. Yeah, that's fast. Oh my gosh. OK, so they're going through the
209480	214300	interaction loop right now, at least over on Hypeboi they are. Yeah, we're looking at Hypeboi.
214380	220140	And let's see. So it's a shop interface. You can open accounts, you can look at shelves,
220140	226160	log into an account. And this is a fairly standard format for a CTF problem, right?
226160	230380	Where there's a menu and you've got different options and each option sort of presents you a
230380	235440	different functionality. And usually it's a combination of those functionalities that you
235440	240320	use to leverage a bug, right? Oh, yeah. Yeah. Whenever I see a menu pop up, my first thought
240320	244520	is heap. And then if I don't see mallocs or anything in there, I'm just like this author
244520	250380	has no idea. Yeah, well, so the last challenge, for example, no menu. It was a straight stack
250380	257500	buffer overflow. The bug was in parsing. And in this case, we're looking at a heap bug and the
257500	266640	menu is classic. Though I think that this one, it's not exactly your typical heap, right? Like
266640	272820	usually there's like one setup, add, delete, print sort of thing. It looked like there was a little
272820	276040	bit more going on in this one. There's a little more going on. You have to do a little bit of
276040	280980	heap manipulation to actually get things to line up where you want it. The gist of it and actually
280980	288440	super dice code just was in the win. Yeah, the win function here. So they already marked a
288440	293680	condition as the win flag, which, you know, it's like an admin check kind of. Okay. I was going to
293680	298340	ask, was it labeled win function? Because I know some of the these like faster challenges. I think
298340	305020	yeah, this is stripped. So they're, they're working from nothing. Gosh. And that's, that is
305020	313260	something that for me, I, I really just love it when I see symbols in a binary, if it's stripped
313260	318880	and you have to, you have to manually annotate what each variable is or function, it can be
318880	323460	time consuming. Yeah. Allow me to be a shill for a second, but Binary Ninja just got auto var naming.
323460	327800	So like, honestly, it's been kind of nice. I used to, when I was testing one of your challenges,
327800	332400	it just sped it up. And that's a good point. And you know, one of the things that I'm
332400	341480	interested to see here is that we've got amazing competitors with really all sorts of tools, but
342120	347900	I think that I've largely just been seeing IDA and debugger use and, you know, phone tools for
347900	352820	scripting, but not a whole lot else. And I was curious what people might bring to these
352820	358580	challenges, whether it's something like anger, symbolic execution, or, or the shellfish team
358580	363840	didn't go for anger, right? I I'm thinking it's a second language for them, which it probably is,
363840	368920	but I does their first language, especially, I think it was Kyle bought for shellfish.
368920	375900	So that doesn't surprise me. But yeah, but with a bug like this, what, what, what's your approach?
375900	380740	So you, we've talked about, okay, so there's a menu, but you know, what's your approach for
380740	384300	trying to find a bug when you see that menu? What are you looking for?
384300	395200	So when I see that menu, I want to look for like misuses. So passing to realloc, malloc zero,
395200	400700	you know, just like an unchecked free, especially in custom memory implementations.
400700	406300	That's a really big one. So those are the first step. And then I go through, I annotate structures.
406300	411240	I want to see like, is it going to be a fast spin thing? Is it going to be a T-cache thing?
411340	416820	Like, because if it's a T-cache thing, you know, it's ABC, it's like a formula.
418140	422660	So I'm looking to see kind of what the allocated chunks would be, how they can push each other
422660	428180	around. If I have any likely, like, or if I have an overwrite, like how far invented out it can I
428180	435440	get, et cetera. Yeah. And, and so you brought up a fast spin T-cache. I think that it's really
435440	440900	important for a lot of folks who are newer to this, that you can get a challenge like this,
440900	445780	and maybe you don't know those techniques, and it can be really intimidating. But a lot of the time,
445780	451760	it is more procedural, I think, than people make it. Once you understand the bug primitive, like,
451760	456300	what does this really give you or allow you to do that you shouldn't be able to do? From there,
456300	460920	as you said, you can say, oh, well, this is, this is playing into, you know,
460920	465960	using a T-cache-based technique or something similar. Really, hacking is just that. It's
465960	471780	building on, you know, baby steps of knowledge and kind of inching closer to your goal. And that's,
471780	478460	you know, hackers are notorious for, you know, having code that works, but it's built on a pile
478460	485760	of hacks. Like, but that, that's kind of a thought process you pick up, is you make tiny steps
485760	492320	towards the eventual goal. Yeah. So, let's take a look at, let's switch over to Hypeboi here.
492560	495900	So, what are we seeing on the, what does it look like they're doing with their debugger over there?
495900	501080	Okay. So, they actually just got double free in T-cache. Oh. Very nice. Making good progress.
501080	505240	Yeah, that's making great progress. I think it's making great progress. I don't remember
505240	512860	the solution right now. It sounds really familiar. But, well, I can see, it looks like they're using
512860	518900	Jeff as their GDB init script. And it looks like they've got a heap helper that they're using,
518900	523260	right? To tell them what they've got. Oh, and those can be invaluable. I used that
523260	526080	when developing this challenge. Yeah. And it was just so nice helping
526940	532400	figure out what the layout was. I used Pwnbag, Pwndebug. But I used to use Jeff.
532940	536760	Both of them are fantastic. Used to use PdoA before that. Yep.
538760	542700	Let's see. So, they're going through, they're figuring out that there's a max number of users.
542860	550100	No. Oh, they're just figuring out that users is a linked list. Okay.
551480	558460	So, going through, figuring out how they get to the double free. And there's a common technique,
558460	565660	or a common technique. There's a way to avoid detecting tcache double frees. And that's to
565660	576020	something in between. You know? It's dumb. But glibc is itself. So, let's see. Setting break
576020	580620	points in... I shouldn't have stripped this. It makes it hard to commentate.
581060	583980	It looks like they're setting break points in the checkout.
584040	591320	Though I will say, it may not be easy to tell from the streams, but these folks are extremely
591320	596840	fast. Oh, they're crazy fast. They are annotating as they're going. And they're typing so fast. If
596840	602020	we had them on the stream, you know, it's just... Oh, it's wild. It's crazy. You see the people...
602020	606500	They're so fast. Yeah. And you think one person is going fast and the other person just suddenly
606500	614320	jumps like five steps ahead of them. It was last match, I think, where... no, two matches ago,
614320	618240	where someone was building a ROP chain before the other guy even started. Other guy just
618240	622380	knocked one out immediately. The guy was still debugging. The first guy was still debugging it.
622380	626140	He's like, oh, my God, I can't believe it. When you're in these high-pressure, you know,
626140	632160	race situations, your thinking just goes all over the place. Your heart rate's up. You're thinking,
632160	635840	like, oh, how far is he? Did he find something I didn't like? He's been paused for kind of a
635840	641160	long time now. Is he just watching his script run? Like, so many things going through your mind.
641160	645960	Yeah, I really feel like it's stops and starts, you know? Like, you will be...
646340	650880	okay, I see what I need to do here. Get there. And then you need to stop and think and explore
650880	655120	what's the next step. And then, especially at this level, once they know what that next step
655120	659100	is, they are off to the races. Oh, yeah. And it's just bing, bing, bing, bing. And then,
659100	662760	okay, what's the next thing that they have to figure out? Getting from point A to B is something
662760	666820	they've done thousands of times. Yeah, yeah. There really is a lot of practice. In fact,
667300	674020	before we went live on the stream on the last one, I saw one of the competitors pop and open
674140	679540	a challenge binary from a year past or something and practicing right there, right before they went
679540	687340	into this match. Getting his APM up. Oh, my God. You know, you can't... there's so much work that
687340	692620	goes into building the knowledge and the reflexes that these competitors have. Oh, yeah. And just
692620	697320	kind of the sixth sense you get for it, like something sticks out to you that looks totally
697320	702160	mundane and you don't know why. Yeah, that's... I think that that's something that I hear from
702800	708420	pretty much every really seasoned CTF player or vulnerability researcher is,
708420	712960	this looks wrong. There's something wrong here. I may not be able to tell you yet what it is,
712960	722140	but I know something's wrong. Let's pop over to SuperDiceCode. Now, they're
722140	724920	still going through labeling a lot of this stuff.
725520	730740	It looked like they had a little bit more progress than the last time we were looking at them.
730740	736640	So, it looks like they're looking for overflowing a field in the password entry. So,
737260	742160	they've annotated in the comments some field offsets is what it looked like or maybe sizes.
742300	745780	And now they're typing out the struct. Okay, nice.
747420	751880	Oh, yeah, they just pulled it in. Pulled out the decouplation. And now they're... yeah.
753340	761080	Interesting. So, this is a big step of the process is just figuring out what the structs are.
761780	765640	Because when it comes down to it, if you don't know that, you're going to be staring at
765640	770680	I plus 18 and you're going to be thinking like, which one was that again?
771120	776900	Yeah, this is a lot of the behind the scenes work with reverse engineering that I think
776900	783640	if you're an old hand at it, if you're a veteran, you know there's a lot of that
783640	789140	work that you need to do in order to really understand what's going on and have a sense.
789140	795160	And usually, that's not a fast process, especially if you've got a strict binary
795160	801340	or a really large binary. And so, it's really interesting with these speed matches.
801680	806340	You don't want to be spending time annotating, but you kind of have to in order to understand.
806340	810740	Absolutely. It's cost benefit. It's, you know, retaining knowledge in the binary versus
810740	812440	you're losing time for it.
812440	816820	Right. I just saw I'm checking out that admin check, which I'm sure is going to be...
816820	818900	Well, it only lets the best admins through.
819380	822260	It's infallible, obviously. You shouldn't even look at it.
825750	829770	And I'm noticing here, it's interesting that they're flipping back and forth between
829770	833390	the disassembly and the graph view and the decompilation.
834250	838290	Yeah, going in graph view, it's really nice to see kind of interaction loops and switch cases
838830	842910	laid out in front of you and see if there are any complex paths it can take.
842910	843570	Yeah.
843870	845590	And then linear is just nice.
845590	850870	True. I don't know about you, but for decompilation, I want it linear.
850870	853710	But when I'm looking at assembly, I want it in graph view.
853870	860270	And I mean, I learned to RE on disassembly and graph view.
860270	861690	So that's very comfortable for me.
861690	864770	I know some people are linear disassembly all the way.
864770	870210	I like linear because that's how I learned to write assembly, you know, in a file.
870210	872610	So that's how I read it.
873210	877290	Yeah. And I think that, you know, we were just talking about how much time you have
877290	880010	to spend REing or annotating.
880690	887150	One of the things that I was taught and I pass on to anybody that I teach about reverse
887150	892210	engineering is you really want to spend as little time as possible annotating or like
892210	894530	diving into what does this function do?
894530	897870	Unless you're absolutely certain that that's an important function,
897870	899650	because especially in a match like this.
899650	900210	Oh my gosh.
900210	903410	Imagine, you know, there's this function that doesn't really do anything.
903410	904450	The rabbit holes.
904450	905930	Yeah, the rabbit holes.
905970	911810	How many times have you like just gotten dragged into like an optimized stir comp function
911810	916830	or like something that's so obvious when you look at it, when you look back at it?
916830	917070	Right.
917070	920370	But when you're in there, you're just like, oh, this, this moves so much memory around,
920370	921850	like it has to be doing something weird.
921850	922710	There's an offset missing?
922710	925470	No, it's totally fine.
926030	930170	Yeah, and that's something where having the experience, the reps,
930170	935130	understanding common algorithms and what they look like in the decompiler or in the graph,
935130	940290	disassembly graph view can really pay off because, you know, I've been there and I'm sure you have,
940290	944890	or been there working with a team member where they pop open a function and it's,
944890	947610	you know, stripped or whatever, and they just look at it and go,
947610	951190	yep, that's quicksort or that's this hash function.
951210	952650	I don't even need to read it.
952650	957810	No, I feel like everyone competing here has been on both sides of that,
957810	960270	where you're looking at it and you're like, I have no idea what this is doing.
960270	962210	And it's like, no, that's just bubble sort.
962490	966810	Or, you know, you're looking at some algorithm on someone else's screen,
966810	970750	just like from across the room while you're waiting for, you know, Z3 to finish sometime.
971030	976090	And you're just like, oh, you're looking at like Winston Churchill's algorithms.
976370	978130	I couldn't think of one.
978530	980610	Classic. I love Winston Churchill's algorithms.
980610	982930	One of the computers of all time.
983290	985250	Yeah. Little known.
985470	991150	Okay. And so on the superdice code, we see that their exploit script
991150	992750	starting to take some shape here.
992750	995970	They're starting to put the entries from the menu into the script itself, which
996510	1000370	to me gives an indication that they've got an idea of what they're doing.
1000370	1002130	Are they breaking inside of malloc?
1007780	1009440	Well, I see read.
1009440	1014380	Yeah. Well, at the very, oh, yeah, they have some breakpoints inside of libc malloc.
1014380	1020100	Oh, do you think that maybe they have a watch point or something that prints out?
1020100	1023780	Oh, yeah. It looks like it's printing out the pointer and the size for a malloc,
1023780	1028060	which is very smart, especially if you don't have one of those
1029740	1032860	heap introspection tools, it sort of lays it out for you.
1032900	1037120	Yeah. Well, this also just sees because, you know, you could have the heap layout in front of you,
1037120	1038780	but you don't know the previous state of it.
1038820	1042600	This kind of helps you figure out, oh, I need to move this allocation later.
1042600	1049340	Yeah. Yeah. And I'm sure that the the tension is just mounting.
1049340	1054380	And when you when you have to do that sort of thing and instrument malloc.
1054380	1057020	Yeah. That's that's tough.
1057020	1058500	All right. Let's take a look at Hypeboi.
1058500	1061980	Yeah. Hypeboi, it looks like they're making some progress on their exploit.
1062460	1067520	They have once we see it, they have interaction wrappers.
1068380	1071320	No, they don't. They just have commands they're sending raw.
1072820	1076740	Looks like they've got they've tried a few things based on what I'm seeing commented.
1076740	1079760	Oh, yeah. And they're what is that?
1079760	1084960	To creating a user to zero is add an item to cart, I think.
1084960	1086400	Then they log out.
1086560	1089540	OK, that's sounding like like they're moving towards the solution.
1089540	1090840	It sounds like they figured something.
1090840	1093040	Oh, and look, they're laying out the chunks and the sizes.
1093260	1098240	OK. And you see them counting with the mouse.
1098320	1100100	I love that. I do that.
1101000	1104760	Yeah, I don't know about you, but it's often the case for me where
1104760	1108580	I will be trying so many things out in a script that by the end of it,
1108580	1112880	it's like three quarters is junk that I never went down a rabbit hole.
1112880	1113920	Nope, that's not what I want to do.
1113920	1115160	And just commented it out.
1115160	1118060	And there's like five lines of actual work.
1118060	1119960	Yeah, absolutely.
1119960	1122100	Well, you have to do the work to get the final result.
1122600	1124660	You can't just sit down and have a solution to this.
1124660	1126620	You need to work on it.
1126620	1128700	And we see him going through it really fast.
1130280	1133120	Yeah, so fast, just flipping through screens.
1133120	1135540	They have this understanding in their head
1135540	1138100	of the shape of this and what they're trying to do.
1138100	1142620	And you can see him moving between IDA and their terminal and debugger.
1142620	1147140	So it looks like HiPoI hasn't defined a user struct yet.
1147140	1151280	So I don't know if they're just writing it off or if there have been other places.
1151500	1153600	Or maybe they just didn't assign it in that case.
1153920	1158280	Well, you know, as we were saying, it takes time to build struct annotations.
1158280	1160420	Depending on what you're used to doing,
1161840	1164820	maybe they just felt like they didn't have time for it.
1164840	1166500	True, maybe they don't need to.
1168340	1173400	If we take a look on the super dice codes tied here,
1173400	1177280	I think I just saw a double free or a tcache issue.
1177280	1178840	So I feel like they're making progress too.
1178840	1180260	Okay, very nice.
1181660	1183460	Yeah, because they took kind of different approaches,
1183460	1187280	it doesn't surprise me that HiPoI got the first tcache free or tcache double free.
1188280	1191680	Because it looks like super dice code has way more marked up.
1192020	1193920	I noticed that, yeah, as they were going on,
1193920	1196680	they were consistently just annotating, annotating.
1196680	1199880	Yep, we can see they're using phone debug
1199880	1204020	and getting the heap helper to lay out what's going on.
1204020	1206900	Yeah, it may not look it, but these are like two very different approaches.
1206900	1211420	HiPoI going highly dynamic, super dice code going methodical.
1211460	1212700	Well, they're both methodical.
1212700	1215060	But going static and then running, you know,
1215060	1217660	figuring out if his assertions hold.
1217660	1218300	Right.
1218960	1221340	And then going back and annotating some more.
1222240	1227640	And I just saw, I don't know if we've seen checksec yet,
1227640	1231120	but I am, I can't remember what the mitigations were on this.
1231120	1232800	Oh, I'm surprised, yeah.
1232980	1233840	Really shaped.
1234460	1235740	Well, it's a heap exploit.
1235740	1238980	No, no, this has like full railroad, it has pi.
1238980	1240000	Okay, okay.
1240160	1241500	It has canaries.
1241500	1244480	This isn't, if I recall, this is more of a
1244480	1247460	figure out how to do a precise corruption and you win,
1247460	1252440	rather than having to do a full, you know, riprop or...
1252440	1252880	Yeah.
1252880	1257900	So once you get, you know, some write primitive, you...
1259540	1261280	Well, no, I don't think it has pi.
1262920	1263940	I don't remember.
1263940	1266700	But anyway, once you get a controlled write,
1266700	1268340	you overwrite the admin flag and win.
1268340	1271100	There was a win function there that admins get through.
1271360	1273960	Which, of course, they'll never be able to do because they're not admins.
1273960	1275300	Not yet.
1275300	1276980	Yeah, I don't know why they're there, it's crazy.
1277960	1279720	Just a matter of time, I'm sure.
1280220	1285280	Yeah, but I'm, yeah, I'm surprised there's been no checks there.
1286200	1288720	I guess they just haven't found anything to warrant it.
1289340	1295800	Right, well, you know, if it is a heap bug, then your first question probably is,
1295800	1298160	like, what's the bug, right?
1298160	1298820	Yeah.
1300320	1303100	Not an admin, so we see them poking at that,
1303100	1305560	seeing the system call right there.
1305560	1306820	They know they want to get there.
1307040	1307380	Yeah.
1309240	1311700	Ah, so, yep, now they're starting to figure out,
1311700	1314580	okay, what do I need to change to get there?
1314720	1315660	Got it.
1317520	1320760	Oh, yeah, and they're not even calling names, they're calling them chunks.
1320780	1323820	They don't care what they are, they just care about the memory they use.
1323820	1324500	Right.
1327500	1328400	All right.
1331020	1334000	Yep, okay, so we see that they've got on one side,
1334000	1337520	they've used their debugger to instrument the malloc and free calls,
1337520	1342320	see exactly which pointers are getting allocated when, as they're interacting with it.
1342320	1344100	And that's very fast, they've got it in their head.
1344100	1344780	That's really fast.
1344780	1347520	Yep, this command is going to malloc the free mode.
1349540	1356980	So, I feel like they're getting closer and closer.
1356980	1358480	All right, error removing item.
1361750	1362610	All right.
1362610	1363930	Man, they're moving so fast.
1363930	1364030	All right.
1364030	1365990	Yeah, let's hop back over to Hypoi.
1365990	1369450	And they're making good progress.
1369450	1372910	Looks like they've created a second user.
1375070	1377770	And we'll see what else they did once they go back to their script.
1377770	1380750	We have to be faster reading, because they know these scripts really well,
1380750	1383650	and we have to keep track of two of them that they're writing.
1385310	1391230	Yeah, so this is, I think it's funny, this is sort of the tense time when,
1391230	1395050	okay, it's not a quick solve, it's starting to drag on a little bit.
1395050	1399130	Like you said, there's kind of a morale aspect, but there's also hints, right?
1399190	1400570	There's two hints.
1400610	1404670	I think they're at, what are they, 25 and 40 minutes?
1405230	1408090	20, 35, something like that.
1408090	1408270	Yeah.
1408270	1412430	So, they're probably, I don't know how long we've been going here,
1412430	1417630	probably right about on the first hint or so, as far as timing.
1418010	1423630	And it's up to the challenge authors to figure out what is the hint that we should provide
1423630	1429910	to really give them a little bit of a breakthrough, and then that second hint should really be the,
1429910	1432550	all right, you've got, what, like 10 minutes left?
1432550	1435950	So, it should really pretty much lay it out there for them, that second hint.
1435950	1438170	Oh, it does. Oh, it does.
1439610	1441870	Yeah, the first hint, not very helpful.
1442350	1445010	You know, it's a nudge, it's a nub in the right direction.
1445010	1448230	The second hint is shooting them out of a cannon in the right direction.
1448950	1450210	Sometimes you need that.
1450210	1451550	Sometimes, yeah.
1451550	1457150	If you get the second hint, which, to be fair, these aren't the easiest challenges in the world.
1457410	1459990	Like, these aren't your CTF 50-point challenges.
1460490	1465130	Yeah, and I think that that's really important to mention here, is that we sort of categorize
1465130	1468350	these as easy because we want the challengers to be able to solve them.
1468350	1473750	We want it to be more of a speed competition, but it is always hard to know exactly, like,
1473750	1477250	what is, what's the exact difficulty level to get right?
1477250	1481090	And it's really hard to judge that when you have teams from all over the world
1481090	1484330	with different specialties, different members every year.
1485070	1487410	And, you know, they're the best in the world.
1487410	1489170	They're at DEF CON finals.
1489290	1490190	Right, right.
1491730	1497990	Yeah, so going back to the hints real quick, I remember on the first challenge,
1497990	1501310	there was a, we were in that moment where it was a little tense.
1501430	1504210	How long is it going to take to get to a solve here?
1505330	1510650	And so the first hint went out, and I'm pretty sure they looked at the hint, looked at us,
1510650	1512530	and they were like, all right, I already knew that.
1512530	1513750	Like, let me get back to hacking.
1513750	1515090	Why are you distracting me, you know?
1515090	1520850	Yeah, actually, I think the first challenge, the first challenge is pretty long, right?
1520850	1525490	So on the first challenge, now remember, we are, we're doing two matches,
1525490	1527110	two head-to-head matches, right?
1527290	1534190	And on the first challenge, the sort of other match finished very quickly.
1534190	1541030	We're announcing one match, and then the other match is, you can see one stream of each player,
1541030	1546330	and those players solve it quite quickly, at least 10 or 15 minutes faster.
1546330	1551110	And I think that on that, it was really a, somebody noticed a detail that the
1551110	1556170	challenge author left in that made it easier that I think everybody else missed.
1556950	1562790	Yeah, at the end of the first challenge, I was building the, it goes long,
1562870	1565430	a sudden-death challenge, and I was building it, ready to deploy it.
1565530	1565890	Yeah.
1566070	1569930	But right as I finished building it, I was about to ping people that,
1569930	1572150	hey, we need to go sudden-death. They got dissolved.
1572370	1575850	Yeah, it was a tense moment over here at the live CTF HQ.
1575850	1580150	Oh, yeah. I'm really hoping we don't go into sudden-death here.
1580150	1582430	Of course, because it's my challenge, I want them to solve it.
1582430	1582950	Sure.
1582950	1586310	But, you know, I want to give them some closure on the challenge.
1586710	1590430	Right? Oh, I know, I think I saw at least one competitor who,
1590430	1593390	they just wanted to finish, you know?
1593390	1593790	Oh, yeah.
1593790	1596350	They didn't win, but they wanted to finish.
1596350	1599430	They asked, can I stay around and just please debug my ROP chain?
1599430	1599950	Yeah.
1599950	1601390	Like, why didn't it work?
1601390	1611490	Yeah. So let's reassess where we've got SuperDiceCode and see what works.
1611490	1615950	It looks like SuperDiceCode is breaking on the admin checker once again.
1616010	1617770	Setting some breakpoints in their exploits here.
1617770	1618950	Oh, no, they're just calm, yeah.
1618950	1621450	They look like they are on their way.
1622050	1623170	Username and password.
1623590	1624650	Single-stepping.
1627710	1630630	They have a different pwnbag layout than I do, and it's kind of messing with my...
1630630	1632490	Yeah, and they're very fast, right?
1632490	1636690	So I'm used to looking at Jeff, and it's just a little bit different layout.
1637870	1639650	Yeah, we have the screens on the wrong side.
1639650	1641590	I have the Jeff screen and you have pwnbag.
1641810	1642970	Oh, you want to switch seats?
1642970	1644050	No, I'm good.
1647400	1648380	Let's see.
1649320	1652620	I'm definitely looking at that login.
1652620	1655160	Well, SuperDiceCode is annotating everything they can.
1655160	1657120	They're getting a good understanding of the program.
1657120	1660840	Even if the bug hasn't immediately jumped out at them, you know, by the time they reach
1660840	1666220	that intersection of their two kind of growing ends of knowledge, something will click.
1666660	1670180	Yeah, and that's, as you said, the differing approaches.
1670420	1677420	I tend to be more of the, I want dynamic analysis, but I really just want it so I can enrich my
1677980	1686560	static so I have a real understanding or a guarantee that what I'm looking at is what
1686560	1687520	I think it is.
1687520	1691260	Because if I try to do it all statically, you know, there's a lot of question marks
1691260	1692600	in my variable names.
1692840	1695520	Well, you can see on SuperDiceCode they have eight what?
1695560	1699080	Like they have 16 password, eight what?
1700620	1705400	There are so many times I just call something like underscore maybe or underscore maybe not.
1707600	1709180	Offset eight thing.
1711280	1714700	I'm pretty sure I saw LOL go down in a comment somewhere.
1716060	1716860	Oh, here we go.
1716860	1717980	Double free detected.
1717980	1718440	All right.
1718440	1719820	So they have double free.
1720260	1723120	Need to figure out how to bypass that check.
1725790	1729470	And I think you can almost feel it in the pace that they're going.
1729470	1731710	They feel like they're on to something.
1731710	1733110	They feel like they're close.
1734210	1737810	See the TCache chain there.
1737810	1738770	Comprex negative...
1739510	1740750	That was an impact.
1742170	1743370	That's an instruction.
1743370	1743770	Okay.
1743770	1744610	I don't know though.
1744610	1745850	I didn't write it.
1745990	1747050	I was in read.
1749330	1750990	That would explain it.
1752050	1754990	I did not in fact write libc.
1755210	1756690	Believe it or not, I did not do that.
1756690	1757750	You're not the author.
1757750	1758350	No, sorry.
1758350	1759630	I'm not John libc.
1759630	1761610	We'll have to see if we can get them on next time.
1761610	1762190	Yeah.
1766920	1768420	So they're definitely...
1768420	1770740	Oh, so it looks like over on HypeBoy.
1770740	1772040	HypeBoy.
1772060	1777180	They have just kind of highlighted Realloc as a point of interest,
1777180	1782140	which may or may not be a point of interest, but they're breaking on it.
1783300	1784760	There we go.
1786220	1792100	So for Realloc, when you're looking at a Realloc in the context of a challenge like this,
1792100	1794140	what specifically are you looking for?
1795540	1798500	I mean, Realloc is such a specific thing.
1798500	1801860	Going through it, it's usually totally fine.
1801860	1809060	If someone calculates a size wrong, or they increment a list size, like size T,
1809060	1813320	and then Realloc for it, and you have a leak at the end of it.
1813320	1816620	You know, just basic things like that, where you kind of do things out of order.
1817540	1822000	Also, if you pass zero to Realloc, fun fact, it's free.
1822080	1824060	That's what I was going to highlight.
1824060	1824700	Yeah.
1824960	1827980	So that might be relevant.
1827980	1829000	Yep.
1831020	1836000	Realloc is always relevant if you can get a mismatch between the size value going into Realloc
1836000	1842140	and the size of the field as the object itself, or how it's being interacted with.
1842160	1846940	But also, if you can get that value to be zero somehow, Realloc becomes a free.
1846940	1851540	And I am guessing that that's the case.
1851540	1855540	You have to be real careful as a C author with that.
1855540	1856440	Oh, yeah.
1856460	1857620	You got to be real careful.
1857620	1860520	Otherwise, you know, you might end up with tcache double free.
1860520	1862280	And, you know, no one wants that.
1862580	1864020	Especially these players.
1864720	1866380	Oh, I think that they do want it.
1866380	1867380	Oh, nah.
1867840	1869440	That's not how the program's supposed to work.
1869440	1872040	This is a nice little family run shop program.
1872280	1875420	And they're just in here just destroying the heap.
1877920	1880100	And I think I saw some...
1880800	1883440	But yeah, I mean, nice shot.
1883440	1886820	But I think I saw some eggs in there, and I'm just waiting for the shellcode to come out.
1886820	1888700	Oh, wait, they're adding eggs?
1889280	1892000	No, one of the items in the shop.
1892000	1893460	Oh, shell, geez.
1893520	1894100	Yep, I win.
1894100	1898340	Yeah, I'm so like trying to figure out, you know, where they are in this.
1898340	1902880	Because it is part of the solution to put eggs in your cards.
1903700	1906860	Look, we're simple people here.
1907080	1909480	We enjoy our dad jokes.
1910160	1912000	You know, the in jokes in the CTF community.
1912000	1913920	Oh, I saw somebody looking at the rules page.
1913920	1914220	Oh, wait.
1914220	1916800	Oh, they're connecting to a remote instance.
1917340	1919980	Oh, they got a shell.
1920560	1922360	Oh, we might be looking at...
1922360	1922820	At Hypeboy.
1922820	1924040	Yeah, Hypeboy got a shell.
1924040	1924880	They submitted.
1924960	1925980	Hypeboy won.
1926820	1927500	Oh my goodness.
1927500	1928320	Hypeboy wins.
1928340	1930220	And they have a cute cat in their taskbar.
1930700	1931520	Congratulations, Hypeboy.
1931520	1932100	Well done.
1932200	1932880	Well done.
1932880	1933880	How long was that match?
1933880	1934080	Did we...
1934080	1937200	Oh, unknown.
1937220	1937720	Unknown.
1937720	1938540	It was a match.
1938540	1940120	Oh, and they already turned off the stream.
1940180	1940780	They're done.
1941120	1942700	So they're over there shaking hands.
1942700	1944880	Everyone's been fantastic sports.
1944880	1948720	You know, it's been all smiles.
1948720	1950680	No one's salty about this.
1950680	1951920	It's a fun competition.
1951920	1953400	People respect each other here.
1953400	1955540	Everyone knows you've earned your place here.
1955700	1959100	Yeah, I think I've seen disappointment.
1959100	1959780	Sure.
1959880	1962720	But I, you know, shaking hands.
1963240	1965220	I think everybody respects each other.
1965220	1968580	Everybody knows that if you're here, you have made it.
1968580	1973820	And these challenges are hard for no other reason than just the environment that it's in.
1973820	1978380	All of these players have already been playing in, you know, the Olympics of hacking.
1978420	1984780	So to come and play this sprint on the side of it, in the middle of a marathon, if you will.
1986400	1988520	Well, that was another match from us.
1988520	1990100	It was a pleasure casting with you.
1990100	1990460	Yep.
1990460	1991420	I'm glad they solved it.
1991420	1992740	Great working with you, Josh.
1993320	1994960	And good job on the challenge.
1994960	1998940	I think that was appropriately difficult.
1999100	2002520	It was tense there for a bit, but I'm glad that we got to see a solve.
2002520	2005160	That was my nicest challenge.
2005160	2006700	The other ones are mean.
2006980	2009260	So we'll see how those go later.
2010460	2013060	But it's been fun casting.
2013060	2013940	It was a good match.
2013940	2015160	Thank y'all for joining.
2015200	2018540	And we'll be back with another match shortly.
2018540	2019180	Yep.
2019320	2019980	See you soon.
2019980	2020580	Take care.
