start	end	text
0	13710	Hello, everyone. Welcome back to live CTF. We are on the third round of the second day.
14030	17410	My name is Zita2, or Carl, and I'm here with Vy.
17410	23610	Hi, I'm Vy Weiss. Yeah, excited to be here. Scorpio Sun. So, let's go.
23610	30690	Nice. So, we have a match here between Shellfish and Pigbuttsad, and we're just going to get the match started
30690	34750	and we will talk more about the teams and the challenge they are solving.
34750	37690	So, I'm just going to check a quick OK there. Yes?
37690	45190	So, we'll start the match. Let's do a countdown in 5, 4, 3, 2, 1. Let's go.
45350	48670	Awesome. So, we are off to the races.
49290	55730	So, yeah, the first thing that will happen is that the teams download the challenge and start looking at it.
56560	61270	Well, it's going to be interesting to see what various tools they will be using.
61870	67410	We have here, as I said, Pigbuttsad and Shellfish.
68070	77830	Although, we just learned before the match started that the player from Pigbuttsad is at... is it ASU?
77950	80890	Yes, ASU, where Shellfish is from.
80890	84610	Right, so it's kind of like, you know, internal battle.
85890	92570	And, yeah, let's switch over to just look at Pigbuttsad's screen.
92690	95890	OK, they're interacting with the challenge, just seeing what it is.
95890	100430	Already opened in IDA, finding the right function right now.
100430	100950	Right.
100950	103590	It looks like a string format, possibly.
104010	104890	Right.
104890	105890	OK, so...
105890	110150	So we have a classic, like, pawn challenge with, like, a menu.
110210	112330	You can choose various options.
112770	117730	You can see them highlighting these, like, core functions here, like the delete message, edit message.
117730	121770	OK, there's a const char star being casted there.
121870	127750	OK, so for more details, it's a messaging type of menu, so there'll be some user input, it looks like.
129270	130010	Yeah.
130150	132830	We can have a look at Shellfish.
132830	138530	So on their side, we also see IDA also doing, like, the initial reversing.
138750	148330	Looks like they're looking at a little bit of a different part of the code, just tidying up the types, which are a bit messy initially.
149310	151050	Yeah, so...
151050	160850	They're finding the size of the buffer over here at Pigbuttsad, doing initial reconnaissance to find the inputs for any type of function writing to it.
160850	168590	Right. So we see both the teams going for a pretty... starting out with the static analysis, doing, like, the decompilation and so on.
168590	175730	And we've seen throughout the event, you know, the amount of time people spend on the initial, like, static analysis
175730	179610	before they go to kind of, like, the dynamic analysis differs quite a lot.
179610	184390	Like, some people like to do quite a lot of reversing before they start trying exploiting,
184390	188950	and some people just do, like, a very cursory look before they, you know, bring out, like, a debugger and so on.
188950	192350	Oh, that's interesting. So, you know, both teams just went to static analysis first.
192350	192650	Right.
192650	193890	Like, spending a few minutes here.
193890	197470	Yeah. And I mean, I think most of them do that, like, initially.
197470	197630	Yeah.
197630	202190	But we'll see how long they stay here before they start writing some exploits code.
202190	202850	Yeah.
204030	212290	Pigbuttsad is very fast with searching, finding, getting the function pointers, focusing on...
212290	218450	Right. So we have some kind of structure here being defined.
218450	224630	Kind of, like, reconstructing this. Is it, like, a message struct, I think?
224630	232670	Yeah. It looks like there might be different fields to a message, a message head area. We'll see what they can do with that.
232670	243690	Right. And it's a little bit interesting with the... Okay, there it looks starting to look a bit better once you start defining these types.
243690	249450	And, you know, this helps you get a clear, you know, understanding of what's going on.
249630	250350	Yeah.
250490	253770	We can switch over to Shellfish.
253770	257750	Interesting. So Shellfish is actually putting comments in their IDA output.
257750	267870	And you can see they wrote overflow there. So it seems like they have, well, potentially found the bug.
267950	268170	Yeah.
268830	272930	And, you know, now they're trying maybe to figure out how do you get there.
272930	276850	Yes. Yeah. Did you see where they had overflow? Which function?
276850	279670	I think it was the same function that we were looking at before.
279670	286410	Yes. But I'm not entirely sure. You can see there, like, they called something like a maybe next.
286850	290790	Which is, I think, a good strategy. Like, sometimes, you know, you're not completely sure.
290930	294690	You write something, but you make a note to make sure that, like, you know, don't trust this too much.
295910	302870	Yeah. In a limited time, you just keep going. Pigbuttsad instead of comments, just renaming variables, cleaning up everything.
303170	303750	Right.
305090	310330	Yeah. So they're looking at the string compares right now.
310330	318610	Okay. So there's bad words. So it seems in this challenge, it's a message one, but it seems like there's going to be certain words you can't say as the bad word.
318610	323990	And so that might be kind of where we'll want to put any type of payload or bypass there.
324290	328670	So it'll be interesting to see what the bad words are as well as we go through the challenge.
328670	335230	So you can see that big hex constant there. It looked very much in the printable ASCII range.
335230	340070	So there was probably a string that was incorrectly interpreted as a number.
340210	343130	And now we can see some interaction with the binary again.
343130	345830	To be honest, this is how I know that they're kind of competent.
345830	349630	Like, I would just spam the binary. I would just be interacting with it at first.
349850	352290	They're really trying to be more methodical.
353050	360450	And yeah, it's over three minutes in, and they haven't really interacted much with the binary, just spending time.
360450	368670	Yeah, taking their time. It's a big challenge, the kind of meta game or the strategy here.
371150	378250	Because you want to go quick, but if you rush it too much, you might get tangled up in these go-downs.
378250	381590	It might become very messy, and you might actually lose time in the end.
381590	383550	Yeah, for sure.
384490	392490	Okay, so Pigbuttsad is figuring out where the pointers are going to, where the function pointers are going to.
392630	395510	How is Shellfish doing over there?
395510	398970	Right, so here we actually start seeing some exploits.
398970	399410	Oh, they start writing.
399410	403750	Yeah, so you can see here they're using Python with PwnTools.
403750	405650	You know, the popular choice.
405650	405830	Very standard.
405830	414810	And they are kind of defining a new, I guess this is like a new message, this whole interaction with the program.
414810	419210	They're writing these helper functions to make it easy to write these things.
419970	425950	So it looks like they are, you can see there they put hack is probably a bad word.
425950	426290	Yes.
427190	428150	Controversial.
429090	430830	Hacking is not a crime.
430830	436450	But yeah, so it looks like, you know, they already have their string initially being constructed.
436450	439190	They're going to start sending a payload over.
439190	443990	Maybe they're going to send it a few times and try and debug it that way, see what the response is.
443990	446730	But it's interesting that Shellfish is already doing that.
446730	454850	Meanwhile, this team is, they're doing a great job, like really commenting everything, knowing what pointer is doing what.
455370	458870	And so this is clean, very clean what they're doing.
458870	461870	Yeah, so this is kind of what we were talking about.
462830	466510	Shellfish went for starting writing the exploit a bit faster.
466510	470630	And then it's like, was it the right timing or was it too fast?
470630	474770	And will it end up costing them or is it going to give them the win?
474770	475610	Absolutely.
475630	479710	Versus going through the binary more thoroughly.
482070	488090	So this seems like a very basic string sanitization type of bug.
489930	495510	So this seems like a really good beginner CTF if anyone's watching and wants to take notes.
495510	503390	We should actually point that out, that all of the challenges that we run here throughout the event, we will be publishing them.
503390	510430	So if you want to try these things out, we will actually also post all the times that the participants had.
510430	517970	So if you want to try to benchmark yourselves against these very, very good players, there will be a possibility to do so as well.
519270	524370	So right now, Pigbuttsad's focusing on the delete message function here.
524830	527470	What's Shellfish looking at right now?
527470	531470	Switching over to Shellfish, I see that...
531470	533630	Yeah, so you can see that it was very quick.
533630	538150	But in their solve script, they have this thing to create a new message.
538150	539570	And they put in these bad words.
539570	543030	And this is actually the exact right way to go.
543730	547910	Because if I remember correctly, maybe you looked into this more.
547910	555710	The point is that when a bad word gets filtered, it gets replaced by something that's longer.
555710	564030	So it will expand the size of your message, which will eventually overflow the buffer that it's located in.
564570	570030	And you can see that they're concatenating...
570030	572050	Sorry, my eyes are bad.
572690	575110	Yeah, so they're creating new messages.
575110	579270	Those messages don't have any bad words, those are just big sequences of A's and B's.
579270	587130	Yeah, getting padding in to try and make it the right size already without having to have that penalty for writing the bad word.
587130	593330	Exactly. But the interesting thing is that it seems like they're listing out the messages.
593330	597090	And you can see that long sequence of B's, but there were some garbage characters at the end.
597090	601490	So that would kind of suggest that that is a leak.
601490	604970	So maybe they need that for the exportation part.
604970	610550	Are there any Unicode characters or any type of certain interesting characters or just random ones?
610550	612010	Yeah, it looked just like random.
612010	619830	So I suspect this is like you make a message that's just the right amount and then it will print out stuff afterwards.
620530	622770	So a very simple stack overflow there.
622770	623370	Yeah.
623370	629330	And so, oh wow, we have some very nice Python happening over here with pigbuttsad.
629330	632410	Yeah, so they have these templates for their script.
632410	635290	And this is actually kind of cool, you can see that the teams are prepared, right?
635290	643270	Because you have these short two, three-letter functions that are used to just make it faster to type these scripts.
644070	645850	That's very methodical.
647650	650370	They're just encoding the strings to send over to...
651630	655850	There's a GDB attach function that they'll be filling out soon.
655850	656370	Right.
657770	661590	I think it's really cool, they come prepared with these kind of templates.
661590	665590	And I've even heard some teams have been practicing.
665670	672610	They took the challenges from last year and used it as a way to train their speed-pwning abilities.
672610	674650	So teams are definitely taking it seriously.
674650	681490	Here you can see, you hack using one of the bad words and posting just a lot of these bad words.
681490	688030	Yeah, and that's interesting. Instead of doing random characters for getting the padding before a hack, it's just using hack the whole time.
689430	692650	So this means that...
693650	700330	I would say that it seems a little bit like pigbuttsad kind of caught up to Shellfish here with this.
700330	701190	Very quickly.
701190	704630	Yeah, so I think it's a very, very close race.
704650	708890	You can see they're grabbing some offsets from Ida.
710690	715010	And I actually don't know what that command was in GDB.
716170	718910	But that's going to be interesting to see.
719870	723530	And now they are running this with the debugger.
723950	725870	They're just checking the breakpoints.
725870	726850	Yeah.
728770	736530	And that's interesting, the offset he found so quickly in Ida, really doing some nice static analysis paid off there.
736530	745170	Yeah, just putting a breakpoint there to be able to analyze the exploit here.
745170	748310	And you can see those hack, hack, hack messages.
749870	754730	Yeah, so it's a pretty close race here, I would say.
757870	760350	It's not sure exactly what they're doing right now.
760350	764730	But if we look here again at Shellfish, I think they have a very clean exploit script here.
764730	769950	You can see these helper functions for, I think it's like a new message, edit message, delete message.
769950	770670	Yeah, right.
770850	774330	And using these to interact.
774330	777230	So here you can see, it's very nice because it's easy to follow.
777230	780130	Like, oh, they're creating two new messages, deleting one, editing one.
780130	782330	There's some sequence of operation there.
782330	783210	It's nice to follow.
783210	785450	So I appreciate that as a commentator here.
785450	787830	Yeah, absolutely. It's very clean.
788190	791710	And they were able to really quickly find the sanitization function.
791710	794670	They were able to do this very quickly.
794870	795550	Yeah.
796790	802770	And if we go back to Pig again, still doing some debugging.
803070	807490	It looks like now they are in some...
807490	813330	Yeah, I was trying to see where they were doing the break, but I couldn't quite make it out.
813330	815450	Yeah, it's kind of going fast there.
815450	816750	It's going very fast.
817230	820430	So the players, they sit behind us here, behind a wall.
820430	827530	And I've seen some of the matches, like the speed at which they are just typing the stuff is insane.
833090	837610	Oh, so there we can see, on the right side there, you saw the deleted.
837610	838730	The words being removed.
838730	845950	Yes, and then since the string deleted is longer than the string hack, this is what causes the bug.
849430	853190	And they are stepping through the sanitize function.
854630	857510	A lot of stepping to get to the right place.
857510	859050	Yeah, just tapping the button.
859050	862230	Yeah, that's...
865890	872250	We have, if we switch over to Shellfish again, you can see that they run the check sec thing.
872310	876390	And they highlight, I saw the player highlighting the NX enabled.
877370	878650	Oh, here you can see...
878650	883710	You can see the 41, so you can see their payload, the padding for the A's starting.
883710	890510	And trying to maybe figure out the various addresses and offsets, just checking that what ends up in memory
890510	894650	corresponds to what they would expect from their exploits.
895290	897230	This is really classic debugging.
900610	903710	Pigbuttsat is going back and checking...
906680	908920	Right, so it looks like they have...
908920	913440	I'm just trying to see where they are putting their breakpoints.
913440	917000	Because you saw that they were analyzing some contents of the memory there.
917040	920280	But I couldn't quite make out where that was.
920280	923240	It was like in the string comparison stuff.
925420	931960	Oh, at first I thought the word was misspelled, but it's just backwards.
932060	933860	The endian miss.
935920	939000	The deleted endian is backwards, it's great actually.
939000	941100	That's a good team name, Dateled.
941100	944600	If you want to join, we're looking for members.
945840	949360	Have you played any CTFs recently?
949360	953220	Oh man, we did a Hack the Box CTF recently at work.
953220	954600	It was really wholesome.
955060	957460	That's a very good CTF.
957460	961740	It was like a VM reversing challenge, which was nice.
962160	965140	I recommend that as just a really relaxing one too.
965140	966260	What about you?
967260	971220	I'm mostly retired from playing.
971220	972540	I organize a bunch of stuff.
972540	975920	I do every year play the Flareon group.
976560	980080	Hopefully that one should be coming up right now in a few weeks.
980080	981460	I'm looking forward to that.
981460	983000	Hopefully that happens.
983880	988040	Other than that, I've been more organizing than playing the competitions.
988040	990100	When was the last Defcon CTF you played?
990280	991600	Village or main?
991600	998920	I founded NorseCode in 2019.
999200	1002960	I played the two COVID years of the Defcon CTF.
1002960	1005800	I've never played the Defcon CTF on site.
1006840	1010520	I think it was Defcon 2018.
1011480	1015480	There was an RMV8x86 polyglot.
1015480	1018980	Some of the challenges in 2018 were pretty nasty.
1018980	1022380	It must have been 20 and 21 that I played.
1022380	1024420	Those were the COVID years.
1025300	1031360	We can check in with PigBatSat again.
1033380	1035200	NorseCode is here playing.
1038220	1042960	That's a good segue to mention that we are running two matches in parallel.
1043660	1047980	We are commentating this one between Shellfish and PigBatSat.
1047980	1052980	We also have a match between BlueWater and NorseCode.
1053340	1057880	They are playing the same challenge, but off-stream.
1060280	1063440	We have some more debugging action going on here.
1065660	1071040	Just making sure that the start of the payload is being put in the right place.
1071980	1079720	He is using hexadecimal 6-2s to figure out where he needs to...
1079720	1082540	He is left-adjusting the padding.
1082540	1085220	I love seeing an L-adjust and a right-adjust.
1087840	1091080	Using every single convenience function.
1091080	1092860	The built-in Python ones.
1092860	1094780	To your fullest advantage.
1096120	1096760	And...
1097600	1099280	Yeah, it's...
1099960	1102220	Also here looking at...
1102220	1108080	Double-checking the memory mappings to find offsets.
1110820	1112780	Yeah, it's...
1114660	1116020	Switching things up.
1116020	1119860	They got rid of the hack words for now.
1119860	1124420	Maybe they needed to take a step back and check some of their assumptions.
1124420	1127180	Where things are located.
1127180	1130560	He is writing another function here for just editing the message.
1130560	1131700	Okay, yeah.
1132040	1136620	Similar to what Shellfish did over here.
1136940	1141220	You have these helper functions for managing your messages.
1141220	1148460	To not have to repeat so many things in the exploits.
1149280	1155880	I feel like the Shellfish exploit code looks very similar to...
1156580	1160780	Not much has changed, I feel, since we looked at it a moment ago.
1160780	1162400	But hopefully they've been gathering some...
1163320	1166840	Debugging, looking at GDB, setting breakpoints as well.
1167800	1170020	So they've written GDB attached to...
1170020	1172420	That was part of the template that sadbutpig had.
1172420	1174740	Yeah, definitely they came prepared.
1177140	1180820	So pigbuttsad is going back to hack and using the word hack.
1180820	1182960	But now they just have it in their payload.
1182980	1189200	So to simplify it, they made their payload just be the hack bytes.
1191780	1193380	Sending that over.
1194400	1195740	Right, now there's...
1196560	1199520	Yeah, I think something went wrong there.
1199520	1203300	Maybe there was a very large amount of outputs.
1203300	1208320	Yeah, it might be on the size for the 100 hexadecimal.
1208360	1212280	What size of A's and B's are they sending over there?
1212280	1213080	Also 100?
1213080	1215440	Yeah, so Shellfish, I think it was...
1215440	1217300	I've seen various things in their code.
1217300	1219320	Let's see if they switch back to it.
1219500	1222040	I've seen 100, 200...
1222040	1228220	But you can see there's a read call there, reading hex 100 characters.
1228640	1232360	And that's what they're sending there in their two new calls.
1232360	1234340	So, you know, the size is down.
1234340	1236480	It seems like the verbiage is down.
1236480	1240060	It's just really getting the right hexadecimal values in the right places.
1240160	1242140	Which is all CTF.
1242800	1246520	You put the hex in the right memory addresses and then you get it.
1246600	1248560	You know, the good bytes, the bad bytes.
1248880	1251480	The medium bytes, they're all here.
1253140	1255720	But yeah, let's go back to...
1255720	1257880	So, yeah, Pigmetat is still debugging.
1257880	1260260	A lot of A's, a lot of B's we're seeing.
1262860	1265560	I wish I knew the hexadecimal for hack.
1265560	1267400	That would make this a lot helpful.
1267540	1269800	Do you have YouTube comments?
1270140	1271640	Oh, yeah, we should have.
1271640	1273460	If someone knows hack...
1274420	1276000	69, maybe?
1276000	1278360	Yeah, so 69, 41...
1279200	1281060	No, 41 is the capital.
1281160	1282440	So it's 61.
1282440	1284100	Oh, true, 61, yeah.
1286400	1289540	We know how to do the alphabet really easily.
1289800	1290380	68.
1291020	1293360	68, 61, I think, would be the start.
1293360	1294340	And then 63.
1294340	1297140	Wow, great reverse engineering.
1297440	1300000	I feel like this is like a hexadecimal class.
1300000	1301220	Like an intro comp sci.
1301220	1302280	You have to convert.
1302280	1305300	Hello, kids, today we're learning about hexadecimal.
1307980	1309740	We'll go to decimal next.
1309740	1311620	So make sure everyone knows 1 to 10.
1311620	1313380	Or 0 to 9, really.
1313880	1316220	And then next week is binary.
1316980	1318460	Or homework, maybe.
1318460	1319640	We'll give homework.
1319640	1321180	That's what this is. You can do this at home.
1321180	1322540	The challenges are in GitHub.
1323300	1325780	They will be on GitHub.
1331620	1333820	A lot of single-stepping again.
1335600	1338460	So hack is going...
1339700	1342060	Copying and pasting the offsets from Ida.
1342120	1343900	Putting the breakpoint there.
1346100	1347080	All right.
1347080	1348800	So now...
1348800	1351500	They stopped right at the return instructions.
1351500	1353580	Maybe they were looking at the stack layout.
1353580	1356680	At the point of executing the return.
1356680	1356900	Yeah.
1357680	1360300	They're right by RBP, RSP.
1363060	1364260	Yeah.
1365800	1366400	It's...
1366400	1370400	I really feel like both the teams are kind of on to it.
1370400	1372540	They have the pieces.
1372540	1373660	But then, like you said,
1374500	1375860	doing this fiddling
1375860	1377860	and getting things just right
1377860	1380940	can be a big challenge.
1380940	1384360	And especially in this stressful context.
1384360	1385540	And that's so realistic.
1385540	1387520	Because I feel like when you have a code base,
1387520	1388700	finding the bug is easy.
1388700	1391420	Exploiting is way more difficult sometimes.
1392280	1392820	So...
1392820	1394980	Yeah, this is really realistic, I think,
1394980	1397660	of anyone doing a sanitized
1398780	1399720	string buffer
1399720	1402300	overflow situation here.
1402300	1403340	Yeah.
1403400	1406140	I do have a notification
1406140	1408300	here that NorseCode...
1409080	1409980	Let me just
1409980	1411880	confirm this.
1412540	1413760	This is breaking news.
1414260	1416140	We're getting messages.
1417200	1418200	So NorseCode
1418200	1420060	did win the match that
1420060	1421560	we are not commentating.
1421560	1423200	The other match that's running in parallel.
1423260	1425020	Great job to them.
1425800	1427300	Do you feel like a father to the team?
1427300	1428520	Because you found it?
1429100	1429620	It's...
1429620	1432380	You know, father sounds
1432380	1433980	maybe a bit important.
1433980	1436340	Maybe it's like the drunk uncle.
1437500	1438220	Something like this.
1438740	1440040	Every CTF team.
1440040	1441740	Or like the old grandpa
1441740	1444180	who still thinks they're relevant.
1445420	1447040	That's why we're here.
1447380	1447900	Yeah.
1448600	1450520	Like, well, back in my day...
1451260	1451940	Yeah.
1453400	1454140	Something like that.
1454140	1456420	No, but I have some good friends in the team.
1456420	1457820	For example, the guy
1458260	1460240	who did play the match for NorseCode.
1460620	1461500	Yeah, a close friend of mine.
1461500	1464100	So, of course, I'm very happy for them doing well
1464100	1466260	in this CTF.
1466680	1468300	Yeah, definitely cheering for them.
1468380	1470400	Although I have some colleagues from work
1470400	1472220	in some of the other teams as well.
1472300	1474080	Oh, so it's like you're
1474080	1476040	conflicted. How's that doing for you?
1476040	1478620	Is that why you're the drunk uncle and not just the uncle?
1478620	1480080	You have, like, the children.
1480380	1482880	Your nephew's over there. Your niece is there.
1483400	1483560	Oh, yeah.
1483560	1485000	No, it's like...
1485000	1487540	I mean, I like the people
1487540	1488120	in NorseCode.
1489580	1491680	I was not expecting them to...
1491680	1493940	I was expecting them to do okay.
1493940	1495440	But then suddenly they're
1495440	1497340	performing pretty well and they're in fifth place
1497340	1498700	in the overall main event.
1498700	1501280	So now I have to actually cheer for them.
1502100	1503620	So that's super cool to see.
1503620	1505200	Set your expectations low.
1505200	1506720	I think that's kind of moral.
1507600	1509220	Tip of the day.
1510500	1511100	Yeah.
1511100	1512460	I know your alphabet.
1514260	1515480	Yep.
1515480	1517760	Let's check in with Shellfish here.
1517760	1519220	They are going
1519220	1520820	back and forth a bit
1520820	1523080	with AIDA and
1523080	1524960	the debugger. Looks like
1524960	1527100	they are trying
1527960	1529120	to... I'm not sure
1529120	1530960	looking at the sizes of these buffers
1530960	1533140	or something. I don't quite
1533140	1534740	understand the code that's going.
1534740	1537080	They just got the address for
1537080	1539080	where the return happens.
1539080	1540840	I think they're going to put a breakpoint there.
1540840	1542660	That's definitely what's happening.
1542720	1545120	This is really cool over with PigButtSAD.
1545320	1547240	Using GDB, they've
1547240	1548620	got the offsets.
1548940	1551000	They saw where strcpy is getting
1551000	1552880	called, where puts is being called.
1552880	1553700	And now they're just putting
1555320	1555840	that
1557420	1558480	value that ends with
1559080	1560880	4028 into RDI.
1561380	1562700	So now we're finally seeing
1562700	1564840	some registers be called in their
1564840	1565900	Python scripts.
1565900	1567760	A small ROP chain being put
1567760	1568700	together here, which
1569680	1571440	could indicate that they are
1571440	1572640	close.
1572960	1575900	Let's see who gets ripped first.
1576400	1577800	This is exciting, actually.
1577800	1578740	Look what you have.
1579320	1581840	There was a bunch of nullbytes on the stack
1581840	1583720	there, I think. Yeah, right at the RET instruction.
1583720	1585840	So there's something that's slightly off
1585840	1587740	because they got a nullbyte at
1587740	1589720	the RET location.
1589760	1591520	And now there are only two...
1591520	1593600	Well, there's only one nullbyte before there were three.
1593600	1595700	So they're slowly adjusting...
1595700	1597560	I think it's the number of bad words or
1597560	1599760	something. So I feel like they are
1600700	1601400	close.
1601500	1602960	So he called searchmem
1603440	1605240	to see...
1605240	1606720	That went too fast.
1607620	1609160	Okay, so...
1610880	1611640	Okay, and so
1611640	1613620	they have the bitmask in the payload
1613620	1615380	too. They're
1615380	1618300	trying to make sure everything lands in the right place.
1621000	1621560	So...
1621560	1622380	They're getting the length
1622380	1624200	of the payload. I'm starting to get excited
1624200	1626500	here now. I feel like
1626500	1627900	they could be
1627900	1630320	one small step
1630320	1632000	away from...
1632000	1634180	They're close to popRDI here.
1634400	1635520	Yeah.
1636220	1638140	Let's see. They're doing some small
1638140	1640320	adjustments. You see some subtracting
1640320	1643240	some stuff from the payloads.
1643920	1644840	So, yeah.
1644840	1645900	Cool, simple wrap
1645900	1647540	chain based
1647540	1649760	exploit for this. This would be a really cool
1649760	1651920	wrap chain beginner on GitHub if anyone
1651920	1653480	wants to do this. I think
1654160	1655620	for a lot of these challenges, because
1655620	1657720	we wanted to be able to solve it within the
1657720	1659740	15 minutes we have, I think we
1659740	1661700	have been fairly generous. Sometimes we put
1661700	1664160	some very useful gadgets.
1664460	1665900	Yeah, so they calculated a little bit
1665900	1667660	of an offset there. Yeah.
1667660	1668700	They got the base address
1669580	1671900	going. Oh, they weren't sure
1671900	1674000	if it was going to be a plus or minus, I think.
1674000	1676600	So, yeah.
1676600	1676780	It's
1679500	1680060	very
1680060	1680760	close.
1681740	1683300	How's Shellfish doing?
1683300	1685920	Let's go back at Shellfish. This is so
1685920	1688160	exciting. Pigbuttsat is almost
1688160	1690080	getting it. We'll have to have one eye over on that screen.
1690080	1691820	Okay, you do that.
1694420	1695920	It seems like
1695920	1698080	the Shellfish player is flailing around
1698200	1700080	a little bit with a bunch of typos in the terminal.
1700080	1702200	Maybe the stress is getting...
1702200	1703720	Oh, right. He's running RopGadget.
1703720	1706200	He's trying to find some convenient
1707780	1708580	RopGadget.
1708580	1710580	He dumped that out.
1714480	1715980	That would suggest
1715980	1718040	that they're about to
1718040	1719040	put
1719660	1721620	some RopChain together.
1721880	1723820	In Pigbuttsat, they have
1723820	1726220	0xDeadBeef right now in their RopChain.
1726220	1728520	Oh, so they're using this as a
1728520	1729920	marker thing to make sure
1729920	1731320	that they know
1732220	1733940	that if they put this somewhere
1733940	1735780	in memory and they find where it ends up in memory
1735780	1736420	and then they can
1737840	1739520	use this as a marker.
1739920	1740780	That's where the SearchMem
1741800	1743360	command is super helpful.
1744460	1745860	I think they're doing a great job
1745860	1747820	manually backtracing and
1747820	1749900	figuring out...
1749900	1751860	You could see that they were close, but it was something
1751860	1753960	that was a little bit off. You have to backtrack
1754140	1754860	a little bit.
1755560	1758140	This is like a blog post
1758140	1760080	of they already edited everything.
1760080	1762380	They know exactly what they're doing. No mistakes.
1762380	1764120	I haven't seen any typos.
1764120	1766100	I feel bad for you. If typos are
1767560	1768080	happening...
1768080	1769700	Someone should get him a lemonade.
1769800	1771200	Maybe we should.
1771680	1772460	Yeah.
1774660	1775700	And still
1777220	1778080	there's the null
1778080	1779840	byte there when they're at the red instruction.
1779840	1780440	Something is
1782100	1783820	misaligned or something with their
1783820	1785160	exploits.
1785160	1787340	It must be very stressful
1787340	1788900	knowing that you are this close.
1788900	1791060	You don't know how far along the other
1791060	1792580	player is.
1793740	1795020	But it seems like everything
1795020	1796860	is so smart, right?
1796860	1798940	It's not like there's that much lag time.
1798940	1801160	There's constant typing for him.
1801480	1802820	With Shellfish,
1802820	1804780	let's spend some more time here.
1804780	1806480	I feel like we've spent so much time with PigBot 7.
1806920	1808900	They are now putting together the
1808900	1810800	ROP chain here. They used
1810800	1812940	ROP Gadget before, which is a tool to find
1813960	1814900	ROP Gadgets
1814900	1816980	in a binary. They dumped it to a text file.
1816980	1818820	Looking through this and picking
1818820	1821100	and choosing the various things you can see here.
1821100	1822740	They're using this one
1823400	1824460	PopRDI RET
1824460	1826900	Gadget here. They're building up this
1826900	1828360	ROP Chain.
1828800	1831040	You can see a few lines below.
1831040	1833080	They have the start of the payload
1833080	1834920	to trigger the
1834920	1835840	vulnerability.
1836340	1838580	Then they add on
1838580	1839920	the ROP Chain
1839920	1841800	at the end there.
1843100	1843540	Very
1844860	1846180	methodical here.
1846620	1847940	Great comments too. I like how
1847940	1850160	they have PopRDI RET
1850160	1851460	for what they're looking at.
1852340	1853940	Not just making the Gadget,
1853940	1855860	they're showing exactly what instructions they
1855860	1858060	want to start using for their ROP Chain.
1858200	1859940	I think this is really cool to see.
1860540	1862180	A moment ago, I felt
1862180	1864120	like PigBot 7 was a little bit behind
1864120	1865820	with the ROP Chain and stuff. But then
1865820	1868120	something went wrong and they had to debug this.
1868120	1869820	Now, Shellfish is
1869820	1870800	writing this.
1870920	1873540	If they can land this without
1874120	1875940	too big of an issue,
1875940	1877720	they might be able to catch up
1877720	1879700	and overtake them again.
1879700	1882180	It's a really, really close race here.
1888340	1890600	At PigBot 7, they're still using
1890600	1892540	0xDeadBeef to find where in
1892540	1894640	memory they're at right now.
1894640	1896380	They're so close to getting the
1896380	1897380	right return address
1897380	1899840	and being put
1899840	1901080	in the right place.
1905120	1907720	To recap a little bit for the listeners,
1907720	1909420	the idea here is that you have
1909540	1911400	a message and you put bad words
1911400	1913420	into it. The bad words
1913420	1915640	can be short and they get replaced by a
1915640	1917880	longer word, which expands
1917880	1920200	your message and pushes the end.
1920200	1922560	Eventually, it will overflow a buffer.
1922560	1923520	The approach would be
1923520	1924980	you put a bunch of bad words
1924980	1926940	and then an appropriate amount
1926940	1928980	of padding to align everything,
1928980	1930540	and then your ROP chain.
1930540	1932720	You have to align this up so that
1932720	1934380	the thing expands
1934740	1936440	just the right amount of
1937620	1938260	bytes
1939360	1940840	to put your
1940840	1942960	ROP chain in the correct place.
1947600	1952720	We can see there's definitely something going wrong.
1952720	1953160	You can see here,
1953160	1955800	now they have aligned it.
1955800	1957360	You can see they are at the RET instruction
1957360	1960760	and the top is one of their gadgets,
1960760	1962160	I believe.
1963460	1964500	That's very
1965180	1966220	significant.
1967040	1968840	PopRDI is a great gadget
1968840	1970340	to start using there.
1973720	1976000	This is so close.
1976000	1976540	Really?
1976620	1978320	If we switch over to Shellfish...
1978320	1980420	They are typing the same words, basically.
1980720	1982740	I like how with Shellfish
1982740	1985140	you can see the way they are naming it.
1985140	1987520	They are getting the base address of the library.
1987520	1989000	This is a very academic
1989000	1990920	tutorial way to write it.
1990920	1993060	This is export code
1993680	1995560	that I really like.
1996200	1997120	Not too
1997120	1998740	different from how
1998740	2000140	I like to write it.
2000140	2002220	You have some
2002220	2003920	log statements, proper variable
2003920	2005580	names, the whole thing.
2005580	2008040	Of course, that might not necessarily be
2008040	2009860	the most efficient way in a speed
2009860	2011620	pwning setting like this.
2011620	2014500	On the other hand,
2014500	2016180	doing a methodical
2016180	2018080	approach and making sure you do everything right
2018080	2019900	can save you costly
2019900	2020960	mistakes.
2021980	2023960	There's something to be said. You want to be
2023960	2026080	super careful with subtracting
2026080	2028080	the right base address to the function
2028080	2030120	address that you're looking for.
2030120	2030840	Right.
2031980	2033080	Yeah.
2033340	2036180	They have BNSH already written.
2036200	2037320	Yes.
2038700	2040000	I think
2040000	2041640	they could...
2041640	2043960	It's so close here.
2044120	2045860	They're doing maybe some final debugging.
2045860	2047060	Could we possibly see
2047860	2049860	this working? I want to
2049860	2052120	just look at them for a short
2052120	2053800	moment more here
2053800	2056080	to see if things
2056080	2057720	are... Oh, look.
2057720	2058860	You have the RET
2058860	2062120	that was pointing at the
2062120	2063720	ROP address. Sorry.
2063720	2066040	The ROP chain was on the
2066040	2067660	stack at the RET address.
2067660	2070420	It really looks like they are right there.
2070420	2071420	Yeah.
2073400	2075460	Oh, and now they are
2076080	2078160	duplicating the...
2078160	2079680	Interesting.
2079920	2082440	They're duplicating getting their shell.
2083060	2083900	They have
2083900	2085180	the SHN system.
2085520	2086960	Oh, actually, that was
2087560	2089740	very interesting. The first ROP
2089740	2091640	chain goes
2091640	2092960	back to main.
2093500	2095480	Wow, this is pretty...
2096240	2097500	It looks like they're doing
2097500	2099320	one ROP chain... To overwrite
2100700	2101700	the entry point
2101700	2102700	of the message?
2104920	2105720	I don't know.
2105720	2107340	Because that first ROP chain
2107340	2109280	ends with the main symbol, so it would
2109280	2110980	jump back to main and essentially
2110980	2113600	restart the program.
2113720	2114120	And then
2114940	2117460	Ewing is doing some kind of leak.
2117720	2119100	And then... Oh, I think this
2119860	2121020	is... I mean,
2121020	2122840	this might absolutely be a solution, but
2122840	2123680	it looks
2124760	2126460	way more complex
2126980	2129460	than our reference solution.
2129620	2131200	Pigbuttsad is also looking at it.
2131200	2131920	Yeah, yeah, yeah.
2132460	2135120	But, I mean, in the end, a flag
2135120	2136040	is a flag.
2136820	2137740	A win is a win.
2137740	2138360	Yeah.
2139240	2141640	If you took a long detour and still got there
2141640	2143900	faster, then good on you.
2144560	2145280	Okay, so they're putting
2145280	2147380	agent now into their payload for
2147380	2148340	debugging.
2151880	2152740	Okay, so
2154160	2155600	they're unpacking.
2155680	2156720	They have U64
2157280	2159340	being called for unpacking.
2159500	2161620	So they did a small leak.
2164120	2165080	And then...
2166080	2167060	Okay, and there they
2167060	2168700	have the libc address
2168700	2170140	as well.
2171160	2172680	Did we... Yeah, okay.
2176380	2178660	It's getting the
2178660	2181120	base text. Okay, so this is just basic
2181120	2183120	calculating the base. Meanwhile,
2183120	2184860	it's interesting. Shellfish is already
2184860	2186920	writing, like, a second prop
2186920	2188980	chain. And we're just over
2188980	2191040	here still getting... Not that it's bad. I really
2191040	2193120	like how methodical Pigbuttsad is.
2193120	2195100	But it's interesting to see that
2195100	2196620	Shellfish is basically just
2197840	2198800	brute-forcing
2198800	2201120	the second prop chain. Yeah, it's actually interesting
2201120	2203080	if you look at the screen here. They're kind
2203080	2205120	of debugging here. You can see they are at the ret instruction
2205120	2206820	in the debugger. And then you have this 41
2206820	2209060	string at the top of
2209060	2211120	the stack. So
2211640	2213120	I think they are using that
2213120	2214860	to double-check that the prop
2214860	2217220	chain is being
2217220	2219260	put in the proper location
2219260	2221000	in memory.
2221000	2222680	So they could be
2224000	2225180	close. And now
2225820	2226780	they are
2226780	2229000	copying some data from the top of the
2229000	2231040	stack. Oh, they're using the cyclic.
2231040	2233140	Yeah, that's cool. So Shellfish is using
2233260	2234920	a lot more, like, tooling.
2235640	2237200	So the cyclic function
2237200	2239160	it generates a
2239940	2241140	sequence which you can then
2241680	2243340	input into your program. And then
2243340	2245200	you can take a very small substring
2245200	2247500	of that sequence and then
2247500	2248840	calculate back the index. So this can
2248840	2250640	really help you figure out what
2250640	2252700	offset, you know...
2252700	2254780	That's interesting. We have more manual offset
2254780	2256760	calculation here. Yeah, a lot
2256760	2258800	less commands happening. Right.
2260800	2261280	It's...
2261280	2262280	Oh!
2262900	2264840	There was a shell here.
2264920	2266540	Oh, we have a shell. Yeah, yeah, yeah.
2266540	2268080	I saw the execve.
2268160	2271080	So they have execve being called.
2271140	2272820	They're switching to the remote. You see
2272820	2274640	instead of process, they're switching to remote.
2274640	2275860	Oh, they might have something there.
2275860	2277300	Yeah, yeah. So this is going to be
2277940	2279360	a solve. They're putting in the host
2279360	2281980	and the port name.
2282500	2283820	And let's see.
2283820	2285060	They're running it.
2286120	2287780	Pigbuttsad hasn't even...
2287780	2289540	Oh, right. They removed the db.
2289800	2292240	And they have... Yeah. Okay, let's see.
2293040	2293780	They got it.
2293780	2295600	They got it. Wow. They got it.
2295620	2297820	Congratulations. Really
2297820	2300100	nice. Really nice. Congrats to shellfish.
2300100	2301260	Yeah, shellfish.
2301680	2303540	Advancing in the tournament.
2303540	2305580	Unfortunately, Pigbuttsad
2305580	2307480	are knocked out of the
2307480	2310020	live CTF tournament, but they had a
2310020	2313260	great run. Really well played.
2313260	2314060	That was excellent.
2314060	2315700	Seeing the template that they brought, too.
2315700	2317690	You could tell this team really is
2318280	2319600	sophisticated, knows what they're doing.
2319600	2322200	Good luck to them throughout the entire
2322200	2324000	CTF, too. Right.
2324000	2327460	And shellfish, this was great. Seeing the
2327460	2328340	second attempt for
2328340	2329780	roping there.
2329780	2330940	Yeah, it's really, really cool.
2331440	2333080	So that means they will advance
2333080	2334540	on to the next round.
2335240	2337080	Yeah, this was super fun.
2337080	2338980	This was great, yeah. Yeah, thanks for
2338980	2341120	coming on as a commentator. Thanks for commentating.
2341180	2343000	And we will go
2343000	2344920	to a short break.
2344920	2346480	We will be back.
2346760	2349160	I'm 0xSleep on Twitter. If anyone
2349160	2350740	wants to talk, I'm
2351540	2353260	Vee on BlueSky.
2353260	2355040	If anyone's on BlueSky. So
2355040	2356700	see ya. Have a good one.
2357080	2359100	Before I sign off here, just take a
2359100	2361020	quick look at the bracket. As I said,
2361020	2362840	we had PigBotSAD will be facing
2362840	2364780	Shellfish in the next one. And then
2367020	2368860	no, sorry, that was just what happened.
2368860	2371300	Shellfish won against PigBotSAD.
2371460	2372700	And NorseCode won their match. So it's
2372700	2375040	Shellfish versus NorseCode? No, so what's happening
2375040	2377040	is this is the lower bracket. So you have
2377040	2379020	the upper bracket here. You have Macaroni
2379020	2380980	versus Hypeboy. And then you have MMM
2380980	2382600	versus StrawHat. And the
2382600	2385140	respective losers of those matches will face
2385140	2387400	against Shellfish or NorseCode.
2387400	2389920	Okay. So that's it.
2390600	2391560	Shout out to StrawHat.
2391560	2393720	Great team name. Big One Piece fan.
2393720	2395380	So love to see it. So who
2395380	2397300	is the next one coming up? I think we have
2397300	2399480	it's both of those two matches. Macaroni and Hypeboy
2399480	2401440	and MMM and StrawHat. I don't remember
2401440	2403360	which one of those we are commentating. But we
2403360	2405780	will be back here soon.
2406220	2407620	And yeah.
2407620	2408700	Have a nice day. Bye.
