1 00:00:00,000 --> 00:00:04,580 Hello, 2 00:00:07,770 --> 00:00:08,390 everyone. 3 00:00:08,390 --> 00:00:10,970 Welcome back to live CTF. 4 00:00:10,970 --> 00:00:13,710 We are on the third round of the second day. 5 00:00:14,030 --> 00:00:17,410 My name is Zita2, or Carl, and I'm here with Vy. 6 00:00:17,410 --> 00:00:19,130 Hi, I'm Vy Weiss. 7 00:00:19,570 --> 00:00:21,410 Yeah, excited to be here. 8 00:00:21,410 --> 00:00:22,470 Scorpio Sun. 9 00:00:22,470 --> 00:00:23,610 So, let's go. 10 00:00:23,610 --> 00:00:24,030 Nice. 11 00:00:24,030 --> 00:00:34,750 So, we have a match here between Shellfish and Pigbuttsad, and we're just going to get the match started and we will talk more about the teams and the challenge they are solving. 12 00:00:34,750 --> 00:00:37,250 So, I'm just going to check a quick OK there. 13 00:00:37,250 --> 00:00:37,690 Yes? 14 00:00:37,690 --> 00:00:38,850 So, we'll start the match. 15 00:00:38,850 --> 00:00:44,230 Let's do a countdown in 5, 4, 3, 2, 1. 16 00:00:44,230 --> 00:00:45,190 Let's go. 17 00:00:45,350 --> 00:00:46,210 Awesome. 18 00:00:46,570 --> 00:00:48,670 So, we are off to the races. 19 00:00:49,290 --> 00:00:55,730 So, yeah, the first thing that will happen is that the teams download the challenge and start looking at it. 20 00:00:56,560 --> 00:01:01,270 Well, it's going to be interesting to see what various tools they will be using. 21 00:01:01,870 --> 00:01:07,410 We have here, as I said, Pigbuttsad and Shellfish. 22 00:01:08,070 --> 00:01:17,830 Although, we just learned before the match started that the player from Pigbuttsad is at... is it ASU? 23 00:01:17,950 --> 00:01:20,890 Yes, ASU, where Shellfish is from. 24 00:01:20,890 --> 00:01:24,610 Right, so it's kind of like, you know, internal battle. 25 00:01:25,890 --> 00:01:32,570 And, yeah, let's switch over to just look at Pigbuttsad's screen. 26 00:01:32,690 --> 00:01:35,890 OK, they're interacting with the challenge, just seeing what it is. 27 00:01:35,890 --> 00:01:40,430 Already opened in IDA, finding the right function right now. 28 00:01:40,430 --> 00:01:40,950 Right. 29 00:01:40,950 --> 00:01:43,590 It looks like a string format, possibly. 30 00:01:44,010 --> 00:01:44,890 Right. 31 00:01:44,890 --> 00:01:45,890 OK, so... 32 00:01:45,890 --> 00:01:50,150 So we have a classic, like, pawn challenge with, like, a menu. 33 00:01:50,210 --> 00:01:52,330 You can choose various options. 34 00:01:52,770 --> 00:01:57,730 You can see them highlighting these, like, core functions here, like the delete message, edit message. 35 00:01:57,730 --> 00:02:01,770 OK, there's a const char star being casted there. 36 00:02:01,870 --> 00:02:07,750 OK, so for more details, it's a messaging type of menu, so there'll be some user input, it looks like. 37 00:02:09,270 --> 00:02:10,010 Yeah. 38 00:02:10,150 --> 00:02:12,830 We can have a look at Shellfish. 39 00:02:12,830 --> 00:02:18,530 So on their side, we also see IDA also doing, like, the initial reversing. 40 00:02:18,750 --> 00:02:28,330 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. 41 00:02:29,310 --> 00:02:31,050 Yeah, so... 42 00:02:31,050 --> 00:02:40,850 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. 43 00:02:40,850 --> 00:02:41,410 Right. 44 00:02:41,450 --> 00:02:48,590 So we see both the teams going for a pretty... starting out with the static analysis, doing, like, the decompilation and so on. 45 00:02:48,590 --> 00:02:59,610 And we've seen throughout the event, you know, the amount of time people spend on the initial, like, static analysis before they go to kind of, like, the dynamic analysis differs quite a lot. 46 00:02:59,610 --> 00:03:08,950 Like, some people like to do quite a lot of reversing before they start trying exploiting, and some people just do, like, a very cursory look before they, you know, bring out, like, a debugger and so on. 47 00:03:08,950 --> 00:03:09,970 Oh, that's interesting. 48 00:03:09,970 --> 00:03:12,350 So, you know, both teams just went to static analysis first. 49 00:03:12,350 --> 00:03:12,650 Right. 50 00:03:12,650 --> 00:03:13,890 Like, spending a few minutes here. 51 00:03:13,890 --> 00:03:14,210 Yeah. 52 00:03:14,210 --> 00:03:17,470 And I mean, I think most of them do that, like, initially. 53 00:03:17,470 --> 00:03:17,630 Yeah. 54 00:03:17,630 --> 00:03:22,190 But we'll see how long they stay here before they start writing some exploits code. 55 00:03:22,190 --> 00:03:22,850 Yeah. 56 00:03:24,030 --> 00:03:32,290 Pigbuttsad is very fast with searching, finding, getting the function pointers, focusing on... 57 00:03:32,290 --> 00:03:32,990 Right. 58 00:03:32,990 --> 00:03:38,450 So we have some kind of structure here being defined. 59 00:03:38,450 --> 00:03:40,630 Kind of, like, reconstructing this. 60 00:03:41,770 --> 00:03:44,630 Is it, like, a message struct, I think? 61 00:03:44,630 --> 00:03:44,990 Yeah. 62 00:03:44,990 --> 00:03:49,450 It looks like there might be different fields to a message, a message head area. 63 00:03:50,790 --> 00:03:52,670 We'll see what they can do with that. 64 00:03:52,670 --> 00:03:53,450 Right. 65 00:03:54,470 --> 00:04:03,690 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. 66 00:04:03,690 --> 00:04:09,450 And , you know, this helps you get a clear, you know, understanding of what's going on. 67 00:04:09,630 --> 00:04:10,350 Yeah. 68 00:04:10,490 --> 00:04:13,770 We can switch over to Shellfish. 69 00:04:13,770 --> 00:04:14,090 Interesting . 70 00:04:14,090 --> 00:04:17,750 So Shellfish is actually putting comments in their IDA output. 71 00:04:17,750 --> 00:04:21,290 And you can see they wrote overflow there. 72 00:04:21,290 --> 00:04:27,870 So it seems like they have, well, potentially found the bug. 73 00:04:27,950 --> 00:04:28,170 Yeah . 74 00:04:28,830 --> 00:04:32,930 And, you know, now they're trying maybe to figure out how do you get there. 75 00:04:32,930 --> 00:04:33,370 Yes. 76 00:04:33,370 --> 00:04:33,910 Yeah. 77 00:04:33,910 --> 00:04:35,950 Did you see where they had overflow? 78 00:04:35,950 --> 00:04:36,850 Which function? 79 00:04:36,850 --> 00:04:39,670 I think it was the same function that we were looking at before. 80 00:04:39,670 --> 00:04:40,450 Yes. 81 00:04:40,450 --> 00:04:42,190 But I'm not entirely sure. 82 00:04:42,870 --> 00:04:46,410 You can see there, like, they called something like a maybe next. 83 00:04:46,850 --> 00:04:48,350 Which is, I think, a good strategy. 84 00:04:48,350 --> 00:04:50,790 Like, sometimes, you know, you're not completely sure. 85 00:04:50,930 --> 00:04:54,690 You write something, but you make a note to make sure that, like, you know, don't trust this too much. 86 00:04:55,910 --> 00:04:56,250 Yeah. 87 00:04:56,470 --> 00:04:58,570 In a limited time, you just keep going. 88 00:04:59,090 --> 00:05:02,870 Pigbuttsad instead of comments, just renaming variables, cleaning up everything. 89 00:05:03,170 --> 00:05:03,750 Right. 90 00:05:05,090 --> 00:05:05,930 Yeah. 91 00:05:06,150 --> 00:05:10,330 So they're looking at the string compares right now. 92 00:05:10,330 --> 00:05:10,550 Okay. 93 00:05:10,550 --> 00:05:11,630 So there's bad words. 94 00:05:11,630 --> 00:05:18,610 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. 95 00:05:18,610 --> 00:05:23,990 And so that might be kind of where we'll want to put any type of payload or bypass there. 96 00:05:24,290 --> 00:05:28,670 So it'll be interesting to see what the bad words are as well as we go through the challenge. 97 00:05:28,670 --> 00:05:31,430 So you can see that big hex constant there. 98 00:05:31,430 --> 00:05:35,230 It looked very much in the printable ASCII range. 99 00:05:35,230 --> 00:05:40,070 So there was probably a string that was incorrectly interpreted as a number. 100 00:05:40,210 --> 00:05:43,130 And now we can see some interaction with the binary again. 101 00:05:43,130 --> 00:05:45,830 To be honest, this is how I know that they're kind of competent. 102 00:05:45,830 --> 00:05:47,790 Like, I would just spam the binary. 103 00:05:47,790 --> 00:05:49,630 I would just be interacting with it at first. 104 00:05:49,850 --> 00:05:52,290 They're really trying to be more methodical. 105 00:05:53,050 --> 00:06:00,450 And yeah, it's over three minutes in, and they haven't really interacted much with the binary, just spending time. 106 00:06:00,450 --> 00:06:01,750 Yeah, taking their time. 107 00:06:02,050 --> 00:06:08,670 It's a big challenge, the kind of meta game or the strategy here. 108 00:06:11,150 --> 00:06:18,250 Because you want to go quick, but if you rush it too much, you might get tangled up in these go-downs. 109 00:06:18,250 --> 00:06:21,590 It might become very messy, and you might actually lose time in the end. 110 00:06:21,590 --> 00:06:23,550 Yeah, for sure. 111 00:06:24,490 --> 00:06:32,490 Okay, so Pigbuttsad is figuring out where the pointers are going to, where the function pointers are going to. 112 00:06:32,630 --> 00:06:35,510 How is Shellfish doing over there? 113 00:06:35,510 --> 00:06:38,970 Right , so here we actually start seeing some exploits. 114 00:06:38,970 --> 00:06:39,410 Oh , they start writing. 115 00:06:39,410 --> 00:06:43,750 Yeah, so you can see here they're using Python with PwnTools. 116 00:06:43,750 --> 00:06:45,650 You know, the popular choice. 117 00:06:45,650 --> 00:06:45,830 Very standard . 118 00:06:45,830 --> 00:06:54,810 And they are kind of defining a new, I guess this is like a new message, this whole interaction with the program. 119 00:06:54,810 --> 00:06:59,210 They're writing these helper functions to make it easy to write these things. 120 00:06:59,970 --> 00:07:05,950 So it looks like they are, you can see there they put hack is probably a bad word. 121 00:07:05,950 --> 00:07:06,290 Yes . 122 00:07:07,190 --> 00:07:08,150 Controversial. 123 00:07:09,090 --> 00:07:10,830 Hacking is not a crime. 124 00:07:10,830 --> 00:07:16,450 But yeah, so it looks like, you know, they already have their string initially being constructed. 125 00:07:16,450 --> 00:07:19,190 They're going to start sending a payload over. 126 00:07:19,190 --> 00:07:23,990 Maybe they're going to send it a few times and try and debug it that way, see what the response is. 127 00:07:23,990 --> 00:07:26,730 But it's interesting that Shellfish is already doing that. 128 00:07:26,730 --> 00:07:34,850 Meanwhile, this team is, they're doing a great job, like really commenting everything, knowing what pointer is doing what. 129 00:07:35,370 --> 00:07:38,870 And so this is clean, very clean what they're doing. 130 00:07:38,870 --> 00:07:41,870 Yeah, so this is kind of what we were talking about. 131 00:07:42,830 --> 00:07:46,510 Shellfish went for starting writing the exploit a bit faster. 132 00:07:46,510 --> 00:07:50,630 And then it's like, was it the right timing or was it too fast? 133 00:07:50,630 --> 00:07:54,770 And will it end up costing them or is it going to give them the win? 134 00:07:54,770 --> 00:07:55,610 Absolutely. 135 00:07:55,630 --> 00:07:59,710 Versus going through the binary more thoroughly. 136 00:08:02,070 --> 00:08:08,090 So this seems like a very basic string sanitization type of bug. 137 00:08:09,930 --> 00:08:15,510 So this seems like a really good beginner CTF if anyone's watching and wants to take notes. 138 00:08:15,510 --> 00:08:23,390 We should actually point that out, that all of the challenges that we run here throughout the event, we will be publishing them. 139 00:08:23,390 --> 00:08:30,430 So if you want to try these things out, we will actually also post all the times that the participants had. 140 00:08:30,430 --> 00:08:37,970 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. 141 00:08:39,270 --> 00:08:44,370 So right now, Pigbuttsad's focusing on the delete message function here. 142 00:08:44,830 --> 00:08:47,470 What's Shellfish looking at right now? 143 00:08:47,470 --> 00:08:51,470 Switching over to Shellfish, I see that... 144 00:08:51,470 --> 00:08:53,630 Yeah, so you can see that it was very quick. 145 00:08:53,630 --> 00:08:58,150 But in their solve script, they have this thing to create a new message. 146 00:08:58,150 --> 00:08:59,570 And they put in these bad words. 147 00:08:59,570 --> 00:09:03,030 And this is actually the exact right way to go. 148 00:09:03,730 --> 00:09:07,910 Because if I remember correctly, maybe you looked into this more. 149 00:09:07,910 --> 00:09:15,710 The point is that when a bad word gets filtered, it gets replaced by something that's longer. 150 00:09:15,710 --> 00:09:24,030 So it will expand the size of your message, which will eventually overflow the buffer that it's located in. 151 00:09:24,570 --> 00:09:30,030 And you can see that they're concatenating... 152 00:09:30,030 --> 00:09:32,050 Sorry, my eyes are bad. 153 00:09:32,690 --> 00:09:35,110 Yeah, so they're creating new messages. 154 00:09:35,110 --> 00:09:39,270 Those messages don't have any bad words, those are just big sequences of A's and B's. 155 00:09:39,270 --> 00:09:47,130 Yeah, getting padding in to try and make it the right size already without having to have that penalty for writing the bad word. 156 00:09:47,130 --> 00:09:47,790 Exactly. 157 00:09:47,790 --> 00:09:53,330 But the interesting thing is that it seems like they're listing out the messages. 158 00:09:53,330 --> 00:09:57,090 And you can see that long sequence of B's, but there were some garbage characters at the end. 159 00:09:57,090 --> 00:10:01,490 So that would kind of suggest that that is a leak. 160 00:10:01,490 --> 00:10:04,970 So maybe they need that for the exportation part. 161 00:10:04,970 --> 00:10:10,550 Are there any Unicode characters or any type of certain interesting characters or just random ones? 162 00:10:10,550 --> 00:10:12,010 Yeah, it looked just like random. 163 00:10:12,010 --> 00:10:19,830 So I suspect this is like you make a message that's just the right amount and then it will print out stuff afterwards. 164 00:10:20,530 --> 00:10:22,770 So a very simple stack overflow there. 165 00:10:22,770 --> 00:10:23,370 Yeah . 166 00:10:23,370 --> 00:10:29,330 And so, oh wow, we have some very nice Python happening over here with pigbuttsad. 167 00:10:29,330 --> 00:10:32,410 Yeah, so they have these templates for their script. 168 00:10:32,410 --> 00:10:35,290 And this is actually kind of cool, you can see that the teams are prepared, right? 169 00:10:35,290 --> 00:10:43,270 Because you have these short two, three-letter functions that are used to just make it faster to type these scripts. 170 00:10:44,070 --> 00:10:45,850 That's very methodical. 171 00:10:47,650 --> 00:10:50,370 They're just encoding the strings to send over to... 172 00:10:51,630 --> 00:10:55,850 There's a GDB attach function that they'll be filling out soon. 173 00:10:55,850 --> 00:10:56,370 Right . 174 00:10:57,770 --> 00:11:01,590 I think it's really cool, they come prepared with these kind of templates. 175 00:11:01,590 --> 00:11:05,590 And I've even heard some teams have been practicing. 176 00:11:05,670 --> 00:11:12,610 They took the challenges from last year and used it as a way to train their speed-pwning abilities. 177 00:11:12,610 --> 00:11:14,650 So teams are definitely taking it seriously. 178 00:11:14,650 --> 00:11:21,490 Here you can see, you hack using one of the bad words and posting just a lot of these bad words. 179 00:11:21,490 --> 00:11:22,390 Yeah, and that's interesting. 180 00:11:22,390 --> 00:11:28,030 Instead of doing random characters for getting the padding before a hack, it's just using hack the whole time. 181 00:11:29,430 --> 00:11:32,650 So this means that... 182 00:11:33,650 --> 00:11:40,330 I would say that it seems a little bit like pigbuttsad kind of caught up to Shellfish here with this. 183 00:11:40,330 --> 00:11:41,190 Very quickly. 184 00:11:41,190 --> 00:11:44,630 Yeah, so I think it's a very, very close race. 185 00:11:44,650 --> 00:11:48,890 You can see they're grabbing some offsets from Ida. 186 00:11:50,690 --> 00:11:55,010 And I actually don't know what that command was in GDB. 187 00:11:56,170 --> 00:11:58,910 But that's going to be interesting to see. 188 00:11:59,870 --> 00:12:03,530 And now they are running this with the debugger. 189 00:12:03,950 --> 00:12:05,870 They're just checking the breakpoints. 190 00:12:05,870 --> 00:12:06,850 Yeah. 191 00:12:08,770 --> 00:12:16,530 And that's interesting, the offset he found so quickly in Ida, really doing some nice static analysis paid off there. 192 00:12:16,530 --> 00:12:25,170 Yeah, just putting a breakpoint there to be able to analyze the exploit here. 193 00:12:25,170 --> 00:12:28,310 And you can see those hack, hack, hack messages. 194 00:12:29,870 --> 00:12:34,730 Yeah, so it's a pretty close race here, I would say. 195 00:12:37,870 --> 00:12:40,350 It's not sure exactly what they're doing right now. 196 00:12:40,350 --> 00:12:44,730 But if we look here again at Shellfish, I think they have a very clean exploit script here. 197 00:12:44,730 --> 00:12:49,950 You can see these helper functions for, I think it's like a new message, edit message, delete message. 198 00:12:49,950 --> 00:12:50,670 Yeah, right. 199 00:12:50,850 --> 00:12:54,330 And using these to interact. 200 00:12:54,330 --> 00:12:57,230 So here you can see, it's very nice because it's easy to follow. 201 00:12:57,230 --> 00:13:00,130 Like, oh, they're creating two new messages, deleting one, editing one. 202 00:13:00,130 --> 00:13:02,330 There's some sequence of operation there. 203 00:13:02,330 --> 00:13:03,210 It's nice to follow. 204 00:13:03,210 --> 00:13:05,450 So I appreciate that as a commentator here. 205 00:13:05,450 --> 00:13:06,670 Yeah, absolutely. 206 00:13:06,670 --> 00:13:07,830 It's very clean. 207 00:13:08,190 --> 00:13:11,710 And they were able to really quickly find the sanitization function. 208 00:13:11,710 --> 00:13:14,670 They were able to do this very quickly. 209 00:13:14,870 --> 00:13:15,550 Yeah. 210 00:13:16,790 --> 00:13:22,770 And if we go back to Pig again, still doing some debugging. 211 00:13:23,070 --> 00:13:27,490 It looks like now they are in some... 212 00:13:27,490 --> 00:13:33,330 Yeah, I was trying to see where they were doing the break, but I couldn't quite make it out. 213 00:13:33,330 --> 00:13:35,450 Yeah, it's kind of going fast there. 214 00:13:35,450 --> 00:13:36,750 It's going very fast. 215 00:13:37,230 --> 00:13:40,430 So the players, they sit behind us here, behind a wall. 216 00:13:40,430 --> 00:13:47,530 And I've seen some of the matches, like the speed at which they are just typing the stuff is insane. 217 00:13:53,090 --> 00:13:57,610 Oh, so there we can see, on the right side there, you saw the deleted. 218 00:13:57,610 --> 00:13:58,730 The words being removed. 219 00:13:58,730 --> 00:14:05,950 Yes, and then since the string deleted is longer than the string hack, this is what causes the bug. 220 00:14:09,430 --> 00:14:13,190 And they are stepping through the sanitize function. 221 00:14:14,630 --> 00:14:17,510 A lot of stepping to get to the right place. 222 00:14:17,510 --> 00:14:19,050 Yeah, just tapping the button. 223 00:14:19,050 --> 00:14:22,230 Yeah, that's... 224 00:14:25,890 --> 00:14:32,250 We have, if we switch over to Shellfish again, you can see that they run the check sec thing. 225 00:14:32,310 --> 00:14:36,390 And they highlight, I saw the player highlighting the NX enabled. 226 00:14:37,370 --> 00:14:38,650 Oh, here you can see... 227 00:14:38,650 --> 00:14:43,710 You can see the 41, so you can see their payload, the padding for the A's starting. 228 00:14:43,710 --> 00:14:54,650 And trying to maybe figure out the various addresses and offsets, just checking that what ends up in memory corresponds to what they would expect from their exploits. 229 00:14:55,290 --> 00:14:57,230 This is really classic debugging. 230 00:15:00,610 --> 00:15:03,710 Pigbuttsat is going back and checking... 231 00:15:06,680 --> 00:15:08,920 Right, so it looks like they have... 232 00:15:08,920 --> 00:15:13,440 I'm just trying to see where they are putting their breakpoints. 233 00:15:13,440 --> 00:15:17,000 Because you saw that they were analyzing some contents of the memory there. 234 00:15:17,040 --> 00:15:20,280 But I couldn't quite make out where that was. 235 00:15:20,280 --> 00:15:23,240 It was like in the string comparison stuff. 236 00:15:25,420 --> 00:15:31,960 Oh, at first I thought the word was misspelled, but it's just backwards. 237 00:15:32,060 --> 00:15:33,860 The endian miss. 238 00:15:35,920 --> 00:15:39,000 The deleted endian is backwards, it's great actually. 239 00:15:39,000 --> 00:15:41,100 That's a good team name, Dateled. 240 00:15:41,100 --> 00:15:44,600 If you want to join, we're looking for members. 241 00:15:45,840 --> 00:15:49,360 Have you played any CTFs recently? 242 00:15:49,360 --> 00:15:53,220 Oh man, we did a Hack the Box CTF recently at work. 243 00:15:53,220 --> 00:15:54,600 It was really wholesome. 244 00:15:55,060 --> 00:15:57,460 That's a very good CTF. 245 00:15:57,460 --> 00:16:01,740 It was like a VM reversing challenge, which was nice. 246 00:16:02,160 --> 00:16:05,140 I recommend that as just a really relaxing one too. 247 00:16:05,140 --> 00:16:06,260 What about you? 248 00:16:07,260 --> 00:16:11,220 I'm mostly retired from playing. 249 00:16:11,220 --> 00:16:12,540 I organize a bunch of stuff. 250 00:16:12,540 --> 00:16:15,920 I do every year play the Flareon group. 251 00:16:16,560 --> 00:16:20,080 Hopefully that one should be coming up right now in a few weeks. 252 00:16:20,080 --> 00:16:21,460 I'm looking forward to that. 253 00:16:21,460 --> 00:16:23,000 Hopefully that happens. 254 00:16:23,880 --> 00:16:28,040 Other than that, I've been more organizing than playing the competitions. 255 00:16:28,040 --> 00:16:30,100 When was the last Defcon CTF you played? 256 00:16:30,280 --> 00:16:31,600 Village or main? 257 00:16:31,600 --> 00:16:38,920 I founded NorseCode in 2019. 258 00:16:39,200 --> 00:16:42,960 I played the two COVID years of the Defcon CTF. 259 00:16:42,960 --> 00:16:45,800 I've never played the Defcon CTF on site. 260 00:16:46,840 --> 00:16:50,520 I think it was Defcon 2018. 261 00:16:51,480 --> 00:16:55,480 There was an RMV8x86 polyglot. 262 00:16:55,480 --> 00:16:58,980 Some of the challenges in 2018 were pretty nasty. 263 00:16:58,980 --> 00:17:02,380 It must have been 20 and 21 that I played. 264 00:17:02,380 --> 00:17:04,420 Those were the COVID years. 265 00:17:05,300 --> 00:17:11,360 We can check in with PigBatSat again. 266 00:17:13,380 --> 00:17:15,200 NorseCode is here playing. 267 00:17:18,220 --> 00:17:22,960 That's a good segue to mention that we are running two matches in parallel. 268 00:17:23,660 --> 00:17:27,980 We are commentating this one between Shellfish and PigBatSat. 269 00:17:27,980 --> 00:17:32,980 We also have a match between BlueWater and NorseCode. 270 00:17:33,340 --> 00:17:37,880 They are playing the same challenge, but off-stream. 271 00:17:40,280 --> 00:17:43,440 We have some more debugging action going on here. 272 00:17:45,660 --> 00:17:51,040 Just making sure that the start of the payload is being put in the right place. 273 00:17:51,980 --> 00:17:59,720 He is using hexadecimal 6-2s to figure out where he needs to... 274 00:17:59,720 --> 00:18:02,540 He is left-adjusting the padding. 275 00:18:02,540 --> 00:18:05,220 I love seeing an L-adjust and a right-adjust. 276 00:18:07,840 --> 00:18:11,080 Using every single convenience function. 277 00:18:11,080 --> 00:18:12,860 The built-in Python ones. 278 00:18:12,860 --> 00:18:14,780 To your fullest advantage. 279 00:18:16,120 --> 00:18:16,760 And... 280 00:18:17,600 --> 00:18:19,280 Yeah, it's... 281 00:18:19,960 --> 00:18:22,220 Also here looking at... 282 00:18:22,220 --> 00:18:28,080 Double-checking the memory mappings to find offsets. 283 00:18:30,820 --> 00:18:32,780 Yeah, it's... 284 00:18:34,660 --> 00:18:36,020 Switching things up. 285 00:18:36,020 --> 00:18:39,860 They got rid of the hack words for now. 286 00:18:39,860 --> 00:18:44,420 Maybe they needed to take a step back and check some of their assumptions. 287 00:18:44,420 --> 00:18:47,180 Where things are located. 288 00:18:47,180 --> 00:18:50,560 He is writing another function here for just editing the message. 289 00:18:50,560 --> 00:18:51,700 Okay, yeah. 290 00:18:52,040 --> 00:18:56,620 Similar to what Shellfish did over here. 291 00:18:56,940 --> 00:19:01,220 You have these helper functions for managing your messages. 292 00:19:01,220 --> 00:19:08,460 To not have to repeat so many things in the exploits. 293 00:19:09,280 --> 00:19:15,880 I feel like the Shellfish exploit code looks very similar to... 294 00:19:16,580 --> 00:19:20,780 Not much has changed, I feel, since we looked at it a moment ago. 295 00:19:20,780 --> 00:19:22,400 But hopefully they've been gathering some... 296 00:19:23,320 --> 00:19:26,840 Debugging, looking at GDB, setting breakpoints as well. 297 00:19:27,800 --> 00:19:30,020 So they've written GDB attached to... 298 00:19:30,020 --> 00:19:32,420 That was part of the template that sadbutpig had. 299 00:19:32,420 --> 00:19:34,740 Yeah, definitely they came prepared. 300 00:19:37,140 --> 00:19:40,820 So pigbuttsad is going back to hack and using the word hack. 301 00:19:40,820 --> 00:19:42,960 But now they just have it in their payload. 302 00:19:42,980 --> 00:19:49,200 So to simplify it, they made their payload just be the hack bytes. 303 00:19:51,780 --> 00:19:53,380 Sending that over. 304 00:19:54,400 --> 00:19:55,740 Right, now there's... 305 00:19:56,560 --> 00:19:59,520 Yeah, I think something went wrong there. 306 00:19:59,520 --> 00:20:03,300 Maybe there was a very large amount of outputs. 307 00:20:03,300 --> 00:20:08,320 Yeah, it might be on the size for the 100 hexadecimal. 308 00:20:08,360 --> 00:20:12,280 What size of A's and B's are they sending over there? 309 00:20:12,280 --> 00:20:13,080 Also 100? 310 00:20:13,080 --> 00:20:15,440 Yeah, so Shellfish, I think it was... 311 00:20:15,440 --> 00:20:17,300 I've seen various things in their code. 312 00:20:17,300 --> 00:20:19,320 Let's see if they switch back to it. 313 00:20:19,500 --> 00:20:22,040 I've seen 100, 200... 314 00:20:22,040 --> 00:20:28,220 But you can see there's a read call there, reading hex 100 characters. 315 00:20:28,640 --> 00:20:32,360 And that's what they're sending there in their two new calls. 316 00:20:32,360 --> 00:20:34,340 So, you know, the size is down. 317 00:20:34,340 --> 00:20:36,480 It seems like the verbiage is down. 318 00:20:36,480 --> 00:20:40,060 It's just really getting the right hexadecimal values in the right places. 319 00:20:40,160 --> 00:20:42,140 Which is all CTF. 320 00:20:42,800 --> 00:20:46,520 You put the hex in the right memory addresses and then you get it. 321 00:20:46,600 --> 00:20:48,560 You know, the good bytes, the bad bytes. 322 00:20:48,880 --> 00:20:51,480 The medium bytes, they're all here. 323 00:20:53,140 --> 00:20:55,720 But yeah, let's go back to... 324 00:20:55,720 --> 00:20:57,880 So , yeah, Pigmetat is still debugging. 325 00:20:57,880 --> 00:21:00,260 A lot of A's, a lot of B's we're seeing. 326 00:21:02,860 --> 00:21:05,560 I wish I knew the hexadecimal for hack. 327 00:21:05,560 --> 00:21:07,400 That would make this a lot helpful. 328 00:21:07,540 --> 00:21:09,800 Do you have YouTube comments? 329 00:21:10,140 --> 00:21:11,640 Oh, yeah, we should have. 330 00:21:11,640 --> 00:21:13,460 If someone knows hack... 331 00:21:14,420 --> 00:21:16,000 69, maybe? 332 00:21:16,000 --> 00:21:18,360 Yeah, so 69, 41... 333 00:21:19,200 --> 00:21:21,060 No, 41 is the capital. 334 00:21:21,160 --> 00:21:22,440 So it's 61. 335 00:21:22,440 --> 00:21:24,100 Oh, true, 61, yeah. 336 00:21:26,400 --> 00:21:29,540 We know how to do the alphabet really easily. 337 00:21:29,800 --> 00:21:30,380 68. 338 00:21:31,020 --> 00:21:33,360 68, 61, I think, would be the start. 339 00:21:33,360 --> 00:21:34,340 And then 63. 340 00:21:34,340 --> 00:21:37,140 Wow, great reverse engineering. 341 00:21:37,440 --> 00:21:40,000 I feel like this is like a hexadecimal class. 342 00:21:40,000 --> 00:21:41,220 Like an intro comp sci. 343 00:21:41,220 --> 00:21:42,280 You have to convert. 344 00:21:42,280 --> 00:21:45,300 Hello, kids, today we're learning about hexadecimal. 345 00:21:47,980 --> 00:21:49,740 We'll go to decimal next. 346 00:21:49,740 --> 00:21:51,620 So make sure everyone knows 1 to 10. 347 00:21:51,620 --> 00:21:53,380 Or 0 to 9, really. 348 00:21:53,880 --> 00:21:56,220 And then next week is binary. 349 00:21:56,980 --> 00:21:58,460 Or homework, maybe. 350 00:21:58,460 --> 00:21:59,640 We'll give homework. 351 00:21:59,640 --> 00:22:00,340 That's what this is. 352 00:22:00,340 --> 00:22:01,180 You can do this at home. 353 00:22:01,180 --> 00:22:02,540 The challenges are in GitHub. 354 00:22:03,300 --> 00:22:05,780 They will be on GitHub. 355 00:22:11,620 --> 00:22:13,820 A lot of single-stepping again. 356 00:22:15,600 --> 00:22:18,460 So hack is going... 357 00:22:19,700 --> 00:22:22,060 Copying and pasting the offsets from Ida. 358 00:22:22,120 --> 00:22:23,900 Putting the breakpoint there. 359 00:22:26,100 --> 00:22:27,080 All right. 360 00:22:27,080 --> 00:22:28,800 So now... 361 00:22:28,800 --> 00:22:31,500 They stopped right at the return instructions. 362 00:22:31,500 --> 00:22:33,580 Maybe they were looking at the stack layout. 363 00:22:33,580 --> 00:22:36,680 At the point of executing the return. 364 00:22:36,680 --> 00:22:36,900 Yeah. 365 00:22:37,680 --> 00:22:40,300 They're right by RBP, RSP. 366 00:22:43,060 --> 00:22:44,260 Yeah. 367 00:22:45,800 --> 00:22:46,400 It's... 368 00:22:46,400 --> 00:22:50,400 I really feel like both the teams are kind of on to it. 369 00:22:50,400 --> 00:22:52,540 They have the pieces. 370 00:22:52,540 --> 00:23:00,940 But then, like you said, doing this fiddling and getting things just right can be a big challenge. 371 00:23:00,940 --> 00:23:04,360 And especially in this stressful context. 372 00:23:04,360 --> 00:23:05,540 And that's so realistic. 373 00:23:05,540 --> 00:23:08,700 Because I feel like when you have a code base, finding the bug is easy. 374 00:23:08,700 --> 00:23:11,420 Exploiting is way more difficult sometimes. 375 00:23:12,280 --> 00:23:12,820 So... 376 00:23:12,820 --> 00:23:22,300 Yeah, this is really realistic, I think, of anyone doing a sanitized string buffer overflow situation here. 377 00:23:22,300 --> 00:23:23,340 Yeah. 378 00:23:23,400 --> 00:23:28,300 I do have a notification here that NorseCode... 379 00:23:29,080 --> 00:23:31,880 Let me just confirm this. 380 00:23:32,540 --> 00:23:33,760 This is breaking news. 381 00:23:34,260 --> 00:23:36,140 We're getting messages. 382 00:23:37,200 --> 00:23:41,560 So NorseCode did win the match that we are not commentating. 383 00:23:41,560 --> 00:23:43,200 The other match that's running in parallel. 384 00:23:43,260 --> 00:23:45,020 Great job to them. 385 00:23:45,800 --> 00:23:47,300 Do you feel like a father to the team? 386 00:23:47,300 --> 00:23:48,520 Because you found it? 387 00:23:49,100 --> 00:23:49,620 It's... 388 00:23:49,620 --> 00:23:53,980 You know, father sounds maybe a bit important. 389 00:23:53,980 --> 00:23:56,340 Maybe it's like the drunk uncle. 390 00:23:57,500 --> 00:23:58,220 Something like this. 391 00:23:58,740 --> 00:24:00,040 Every CTF team. 392 00:24:00,040 --> 00:24:04,180 Or like the old grandpa who still thinks they're relevant. 393 00:24:05,420 --> 00:24:07,040 That's why we're here. 394 00:24:07,380 --> 00:24:07,900 Yeah . 395 00:24:08,600 --> 00:24:10,520 Like, well, back in my day... 396 00:24:11,260 --> 00:24:11,940 Yeah. 397 00:24:13,400 --> 00:24:14,140 Something like that. 398 00:24:14,140 --> 00:24:16,420 No, but I have some good friends in the team. 399 00:24:16,420 --> 00:24:20,240 For example, the guy who did play the match for NorseCode. 400 00:24:20,620 --> 00:24:21,500 Yeah, a close friend of mine. 401 00:24:21,500 --> 00:24:26,260 So, of course, I'm very happy for them doing well in this CTF. 402 00:24:26,680 --> 00:24:28,300 Yeah, definitely cheering for them. 403 00:24:28,380 --> 00:24:32,220 Although I have some colleagues from work in some of the other teams as well. 404 00:24:32,300 --> 00:24:34,880 Oh , so it's like you're conflicted. 405 00:24:34,880 --> 00:24:36,040 How's that doing for you? 406 00:24:36,040 --> 00:24:38,620 Is that why you're the drunk uncle and not just the uncle? 407 00:24:38,620 --> 00:24:40,080 You have, like, the children. 408 00:24:40,380 --> 00:24:41,600 Your nephew's over there. 409 00:24:41,600 --> 00:24:42,880 Your niece is there. 410 00:24:43,400 --> 00:24:43,560 Oh, yeah. 411 00:24:43,560 --> 00:24:45,000 No, it's like... 412 00:24:45,000 --> 00:24:48,120 I mean, I like the people in NorseCode. 413 00:24:49,580 --> 00:24:51,680 I was not expecting them to... 414 00:24:51,680 --> 00:24:53,940 I was expecting them to do okay. 415 00:24:53,940 --> 00:24:58,700 But then suddenly they're performing pretty well and they're in fifth place in the overall main event. 416 00:24:58,700 --> 00:25:01,280 So now I have to actually cheer for them. 417 00:25:02,100 --> 00:25:03,620 So that's super cool to see. 418 00:25:03,620 --> 00:25:05,200 Set your expectations low. 419 00:25:05,200 --> 00:25:06,720 I think that's kind of moral. 420 00:25:07,600 --> 00:25:09,220 Tip of the day. 421 00:25:10,500 --> 00:25:11,100 Yeah. 422 00:25:11,100 --> 00:25:12,460 I know your alphabet. 423 00:25:14,260 --> 00:25:15,480 Yep. 424 00:25:15,480 --> 00:25:17,760 Let's check in with Shellfish here. 425 00:25:17,760 --> 00:25:24,360 They are going back and forth a bit with AIDA and the debugger. 426 00:25:24,360 --> 00:25:32,100 Looks like they are trying to... I'm not sure looking at the sizes of these buffers or something. 427 00:25:32,100 --> 00:25:34,740 I don't quite understand the code that's going. 428 00:25:34,740 --> 00:25:39,080 They just got the address for where the return happens. 429 00:25:39,080 --> 00:25:40,840 I think they're going to put a breakpoint there. 430 00:25:40,840 --> 00:25:42,660 That's definitely what's happening. 431 00:25:42,720 --> 00:25:45,120 This is really cool over with PigButtSAD. 432 00:25:45,320 --> 00:25:48,620 Using GDB, they've got the offsets. 433 00:25:48,940 --> 00:25:52,880 They saw where strcpy is getting called, where puts is being called. 434 00:25:52,880 --> 00:26:00,880 And now they're just putting that value that ends with 4028 into RDI. 435 00:26:01,380 --> 00:26:05,900 So now we're finally seeing some registers be called in their Python scripts. 436 00:26:05,900 --> 00:26:12,640 A small ROP chain being put together here, which could indicate that they are close. 437 00:26:12,960 --> 00:26:15,900 Let's see who gets ripped first. 438 00:26:16,400 --> 00:26:17,800 This is exciting, actually. 439 00:26:17,800 --> 00:26:18,740 Look what you have. 440 00:26:19,320 --> 00:26:22,400 There was a bunch of nullbytes on the stack there, I think. 441 00:26:22,400 --> 00:26:23,720 Yeah, right at the RET instruction. 442 00:26:23,720 --> 00:26:29,720 So there's something that's slightly off because they got a nullbyte at the RET location. 443 00:26:29,760 --> 00:26:31,520 And now there are only two... 444 00:26:31,520 --> 00:26:33,600 Well, there's only one nullbyte before there were three. 445 00:26:33,600 --> 00:26:35,700 So they're slowly adjusting... 446 00:26:35,700 --> 00:26:38,280 I think it's the number of bad words or something. 447 00:26:38,480 --> 00:26:41,400 So I feel like they are close. 448 00:26:41,500 --> 00:26:45,240 So he called searchmem to see... 449 00:26:45,240 --> 00:26:46,720 That went too fast. 450 00:26:47,620 --> 00:26:49,160 Okay, so... 451 00:26:50,880 --> 00:26:54,440 Okay, and so they have the bitmask in the payload too. 452 00:26:54,940 --> 00:26:58,300 They're trying to make sure everything lands in the right place. 453 00:27:01,000 --> 00:27:01,560 So... 454 00:27:01,560 --> 00:27:03,060 They're getting the length of the payload. 455 00:27:03,060 --> 00:27:04,900 I'm starting to get excited here now. 456 00:27:04,900 --> 00:27:12,000 I feel like they could be one small step away from... 457 00:27:12,000 --> 00:27:14,180 They're close to popRDI here. 458 00:27:14,400 --> 00:27:15,520 Yeah. 459 00:27:16,220 --> 00:27:16,980 Let's see. 460 00:27:16,980 --> 00:27:18,800 They're doing some small adjustments. 461 00:27:18,800 --> 00:27:23,240 You see some subtracting some stuff from the payloads. 462 00:27:23,920 --> 00:27:24,840 So, yeah. 463 00:27:24,840 --> 00:27:28,800 Cool, simple wrap chain based exploit for this. 464 00:27:28,800 --> 00:27:32,920 This would be a really cool wrap chain beginner on GitHub if anyone wants to do this. 465 00:27:32,920 --> 00:27:40,940 I think for a lot of these challenges, because we wanted to be able to solve it within the 15 minutes we have, I think we have been fairly generous. 466 00:27:40,940 --> 00:27:44,160 Sometimes we put some very useful gadgets. 467 00:27:44,460 --> 00:27:47,240 Yeah, so they calculated a little bit of an offset there. 468 00:27:47,240 --> 00:27:47,660 Yeah. 469 00:27:47,660 --> 00:27:50,380 They got the base address going. 470 00:27:50,700 --> 00:27:54,000 Oh, they weren't sure if it was going to be a plus or minus, I think. 471 00:27:54,000 --> 00:27:56,600 So, yeah. 472 00:27:56,600 --> 00:28:00,760 It's very close. 473 00:28:01,740 --> 00:28:03,300 How's Shellfish doing? 474 00:28:03,300 --> 00:28:05,320 Let's go back at Shellfish. 475 00:28:05,420 --> 00:28:06,880 This is so exciting. 476 00:28:07,120 --> 00:28:08,580 Pigbuttsat is almost getting it. 477 00:28:08,580 --> 00:28:10,080 We'll have to have one eye over on that screen. 478 00:28:10,080 --> 00:28:11,820 Okay, you do that. 479 00:28:14,420 --> 00:28:20,080 It seems like the Shellfish player is flailing around a little bit with a bunch of typos in the terminal. 480 00:28:20,080 --> 00:28:22,200 Maybe the stress is getting... 481 00:28:22,200 --> 00:28:22,600 Oh, right. 482 00:28:22,600 --> 00:28:23,720 He's running RopGadget. 483 00:28:23,720 --> 00:28:28,580 He's trying to find some convenient RopGadget. 484 00:28:28,580 --> 00:28:30,580 He dumped that out. 485 00:28:34,480 --> 00:28:41,620 That would suggest that they're about to put some RopChain together. 486 00:28:41,880 --> 00:28:46,220 In Pigbuttsat, they have 0xDeadBeef right now in their RopChain. 487 00:28:46,220 --> 00:28:59,520 Oh, so they're using this as a marker thing to make sure that they know that if they put this somewhere in memory and they find where it ends up in memory and then they can use this as a marker. 488 00:28:59,920 --> 00:29:03,360 That's where the SearchMem command is super helpful. 489 00:29:04,460 --> 00:29:09,900 I think they're doing a great job manually backtracing and figuring out... 490 00:29:09,900 --> 00:29:13,140 You could see that they were close, but it was something that was a little bit off. 491 00:29:13,140 --> 00:29:14,860 You have to backtrack a little bit. 492 00:29:15,560 --> 00:29:20,080 This is like a blog post of they already edited everything. 493 00:29:20,080 --> 00:29:21,420 They know exactly what they're doing. 494 00:29:21,420 --> 00:29:22,380 No mistakes. 495 00:29:22,380 --> 00:29:24,120 I haven't seen any typos. 496 00:29:24,120 --> 00:29:25,260 I feel bad for you. 497 00:29:25,260 --> 00:29:28,080 If typos are happening... 498 00:29:28,080 --> 00:29:29,700 Someone should get him a lemonade. 499 00:29:29,800 --> 00:29:31,200 Maybe we should. 500 00:29:31,680 --> 00:29:32,460 Yeah. 501 00:29:34,660 --> 00:29:39,840 And still there's the null byte there when they're at the red instruction. 502 00:29:39,840 --> 00:29:45,160 Something is misaligned or something with their exploits. 503 00:29:45,160 --> 00:29:48,900 It must be very stressful knowing that you are this close. 504 00:29:48,900 --> 00:29:52,580 You don't know how far along the other player is. 505 00:29:53,740 --> 00:29:56,860 But it seems like everything is so smart, right? 506 00:29:56,860 --> 00:29:58,940 It's not like there's that much lag time. 507 00:29:58,940 --> 00:30:01,160 There's constant typing for him. 508 00:30:01,480 --> 00:30:04,780 With Shellfish, let's spend some more time here. 509 00:30:04,780 --> 00:30:06,480 I feel like we've spent so much time with PigBot 7. 510 00:30:06,920 --> 00:30:10,100 They are now putting together the ROP chain here. 511 00:30:10,100 --> 00:30:15,780 They used ROP Gadget before, which is a tool to find ROP Gadgets in a binary. 512 00:30:15,780 --> 00:30:16,980 They dumped it to a text file. 513 00:30:16,980 --> 00:30:21,100 Looking through this and picking and choosing the various things you can see here. 514 00:30:21,100 --> 00:30:25,820 They're using this one PopRDI RET Gadget here. 515 00:30:25,820 --> 00:30:28,360 They're building up this ROP Chain. 516 00:30:28,800 --> 00:30:31,040 You can see a few lines below. 517 00:30:31,040 --> 00:30:35,840 They have the start of the payload to trigger the vulnerability. 518 00:30:36,340 --> 00:30:41,800 Then they add on the ROP Chain at the end there. 519 00:30:43,100 --> 00:30:46,180 Very methodical here. 520 00:30:46,620 --> 00:30:47,660 Great comments too. 521 00:30:47,660 --> 00:30:51,460 I like how they have PopRDI RET for what they're looking at. 522 00:30:52,340 --> 00:30:58,060 Not just making the Gadget, they're showing exactly what instructions they want to start using for their ROP Chain. 523 00:30:58,200 --> 00:30:59,940 I think this is really cool to see. 524 00:31:00,540 --> 00:31:05,500 A moment ago, I felt like PigBot 7 was a little bit behind with the ROP Chain and stuff. 525 00:31:05,500 --> 00:31:08,120 But then something went wrong and they had to debug this. 526 00:31:08,120 --> 00:31:10,800 Now, Shellfish is writing this. 527 00:31:10,920 --> 00:31:19,700 If they can land this without too big of an issue, they might be able to catch up and overtake them again. 528 00:31:19,700 --> 00:31:22,180 It's a really, really close race here. 529 00:31:28,340 --> 00:31:34,640 At PigBot 7, they're still using 0xDeadBeef to find where in memory they're at right now. 530 00:31:34,640 --> 00:31:41,080 They're so close to getting the right return address and being put in the right place. 531 00:31:45,120 --> 00:31:52,280 To recap a little bit for the listeners, the idea here is that you have a message and you put bad words into it. 532 00:31:52,380 --> 00:31:59,740 The bad words can be short and they get replaced by a longer word, which expands your message and pushes the end. 533 00:31:59,740 --> 00:32:01,920 Eventually , it will overflow a buffer. 534 00:32:02,000 --> 00:32:10,540 The approach would be you put a bunch of bad words and then an appropriate amount of padding to align everything, and then your ROP chain. 535 00:32:10,540 --> 00:32:22,960 You have to align this up so that the thing expands just the right amount of bytes to put your ROP chain in the correct place. 536 00:32:27,600 --> 00:32:32,720 We can see there's definitely something going wrong. 537 00:32:32,720 --> 00:32:35,800 You can see here, now they have aligned it. 538 00:32:35,800 --> 00:32:42,160 You can see they are at the RET instruction and the top is one of their gadgets, I believe. 539 00:32:43,460 --> 00:32:46,220 That's very significant. 540 00:32:47,040 --> 00:32:50,340 PopRDI is a great gadget to start using there. 541 00:32:53,720 --> 00:32:56,000 This is so close. 542 00:32:56,000 --> 00:32:56,540 Really? 543 00:32:56,620 --> 00:32:58,320 If we switch over to Shellfish... 544 00:32:58,320 --> 00:33:00,420 They are typing the same words, basically. 545 00:33:00,720 --> 00:33:05,140 I like how with Shellfish you can see the way they are naming it. 546 00:33:05,140 --> 00:33:07,520 They are getting the base address of the library. 547 00:33:07,520 --> 00:33:10,920 This is a very academic tutorial way to write it. 548 00:33:10,920 --> 00:33:15,560 This is export code that I really like. 549 00:33:16,200 --> 00:33:20,140 Not too different from how I like to write it. 550 00:33:20,140 --> 00:33:25,580 You have some log statements, proper variable names, the whole thing. 551 00:33:25,580 --> 00:33:31,620 Of course, that might not necessarily be the most efficient way in a speed pwning setting like this. 552 00:33:31,620 --> 00:33:40,960 On the other hand, doing a methodical approach and making sure you do everything right can save you costly mistakes. 553 00:33:41,980 --> 00:33:43,580 There's something to be said. 554 00:33:43,580 --> 00:33:50,120 You want to be super careful with subtracting the right base address to the function address that you're looking for. 555 00:33:50,120 --> 00:33:50,840 Right . 556 00:33:51,980 --> 00:33:53,080 Yeah. 557 00:33:53,340 --> 00:33:56,180 They have BNSH already written. 558 00:33:56,200 --> 00:33:57,320 Yes. 559 00:33:58,700 --> 00:34:01,640 I think they could... 560 00:34:01,640 --> 00:34:03,960 It's so close here. 561 00:34:04,120 --> 00:34:05,860 They're doing maybe some final debugging. 562 00:34:05,860 --> 00:34:09,340 Could we possibly see this working? 563 00:34:09,340 --> 00:34:17,720 I want to just look at them for a short moment more here to see if things are... Oh, look. 564 00:34:17,720 --> 00:34:23,100 You have the RET that was pointing at the ROP address. 565 00:34:23,100 --> 00:34:23,720 Sorry. 566 00:34:23,720 --> 00:34:27,660 The ROP chain was on the stack at the RET address. 567 00:34:27,660 --> 00:34:30,420 It really looks like they are right there. 568 00:34:30,420 --> 00:34:31,420 Yeah. 569 00:34:33,400 --> 00:34:38,160 Oh, and now they are duplicating the... 570 00:34:38,160 --> 00:34:39,680 Interesting. 571 00:34:39,920 --> 00:34:42,440 They're duplicating getting their shell. 572 00:34:43,060 --> 00:34:45,180 They have the SHN system. 573 00:34:45,520 --> 00:34:48,660 Oh, actually, that was very interesting. 574 00:34:48,660 --> 00:34:52,960 The first ROP chain goes back to main. 575 00:34:53,500 --> 00:34:55,480 Wow, this is pretty... 576 00:34:56,240 --> 00:35:02,700 It looks like they're doing one ROP chain... To overwrite the entry point of the message? 577 00:35:04,920 --> 00:35:05,720 I don't know. 578 00:35:05,720 --> 00:35:13,600 Because that first ROP chain ends with the main symbol, so it would jump back to main and essentially restart the program. 579 00:35:13,720 --> 00:35:17,460 And then Ewing is doing some kind of leak. 580 00:35:17,720 --> 00:35:29,460 And then... Oh, I think this is... I mean, this might absolutely be a solution, but it looks way more complex than our reference solution. 581 00:35:29,620 --> 00:35:31,200 Pigbuttsad is also looking at it. 582 00:35:31,200 --> 00:35:31,920 Yeah , yeah, yeah. 583 00:35:32,460 --> 00:35:36,040 But, I mean, in the end, a flag is a flag. 584 00:35:36,820 --> 00:35:37,740 A win is a win. 585 00:35:37,740 --> 00:35:38,360 Yeah. 586 00:35:39,240 --> 00:35:43,900 If you took a long detour and still got there faster, then good on you. 587 00:35:44,560 --> 00:35:48,340 Okay, so they're putting agent now into their payload for debugging. 588 00:35:51,880 --> 00:35:55,600 Okay, so they're unpacking. 589 00:35:55,680 --> 00:35:59,340 They have U64 being called for unpacking. 590 00:35:59,500 --> 00:36:01,620 So they did a small leak. 591 00:36:04,120 --> 00:36:05,080 And then... 592 00:36:06,080 --> 00:36:10,140 Okay, and there they have the libc address as well. 593 00:36:11,160 --> 00:36:12,680 Did we... Yeah, okay. 594 00:36:16,380 --> 00:36:19,840 It's getting the base text. 595 00:36:19,840 --> 00:36:22,640 Okay, so this is just basic calculating the base. 596 00:36:22,640 --> 00:36:23,820 Meanwhile, it's interesting. 597 00:36:23,820 --> 00:36:27,680 Shellfish is already writing, like, a second prop chain. 598 00:36:27,740 --> 00:36:30,560 And we're just over here still getting... Not that it's bad. 599 00:36:30,560 --> 00:36:33,120 I really like how methodical Pigbuttsad is. 600 00:36:33,120 --> 00:36:40,420 But it's interesting to see that Shellfish is basically just brute-forcing the second prop chain. 601 00:36:40,420 --> 00:36:42,600 Yeah, it's actually interesting if you look at the screen here. 602 00:36:42,600 --> 00:36:43,760 They're kind of debugging here. 603 00:36:43,760 --> 00:36:45,960 You can see they are at the ret instruction in the debugger. 604 00:36:45,960 --> 00:36:50,700 And then you have this 41 string at the top of the stack. 605 00:36:50,880 --> 00:37:01,000 So I think they are using that to double-check that the prop chain is being put in the proper location in memory. 606 00:37:01,000 --> 00:37:04,740 So they could be close. 607 00:37:04,740 --> 00:37:09,860 And now they are copying some data from the top of the stack. 608 00:37:09,860 --> 00:37:11,040 Oh, they're using the cyclic. 609 00:37:11,040 --> 00:37:11,900 Yeah, that's cool. 610 00:37:11,900 --> 00:37:14,920 So Shellfish is using a lot more, like, tooling. 611 00:37:15,640 --> 00:37:22,680 So the cyclic function it generates a sequence which you can then input into your program. 612 00:37:22,680 --> 00:37:28,480 And then you can take a very small substring of that sequence and then calculate back the index. 613 00:37:28,480 --> 00:37:32,700 So this can really help you figure out what offset, you know... 614 00:37:32,700 --> 00:37:33,560 That's interesting. 615 00:37:33,560 --> 00:37:36,200 We have more manual offset calculation here. 616 00:37:36,200 --> 00:37:38,120 Yeah, a lot less commands happening. 617 00:37:38,120 --> 00:37:38,800 Right. 618 00:37:40,800 --> 00:37:41,280 It's... 619 00:37:41,280 --> 00:37:42,280 Oh! 620 00:37:42,900 --> 00:37:44,840 There was a shell here. 621 00:37:44,920 --> 00:37:46,060 Oh, we have a shell. 622 00:37:46,060 --> 00:37:46,540 Yeah, yeah, yeah. 623 00:37:46,540 --> 00:37:48,080 I saw the execve. 624 00:37:48,160 --> 00:37:51,080 So they have execve being called. 625 00:37:51,140 --> 00:37:52,600 They're switching to the remote. 626 00:37:52,600 --> 00:37:54,640 You see instead of process, they're switching to remote. 627 00:37:54,640 --> 00:37:55,860 Oh, they might have something there. 628 00:37:55,860 --> 00:37:56,300 Yeah, yeah. 629 00:37:56,300 --> 00:37:58,340 So this is going to be a solve. 630 00:37:58,340 --> 00:38:01,980 They're putting in the host and the port name. 631 00:38:02,500 --> 00:38:03,820 And let's see. 632 00:38:03,820 --> 00:38:05,060 They're running it. 633 00:38:06,120 --> 00:38:07,780 Pigbuttsad hasn't even... 634 00:38:07,780 --> 00:38:08,440 Oh, right. 635 00:38:08,440 --> 00:38:09,540 They removed the db. 636 00:38:09,800 --> 00:38:11,240 And they have... Yeah. 637 00:38:11,240 --> 00:38:12,240 Okay, let's see. 638 00:38:13,040 --> 00:38:13,780 They got it. 639 00:38:13,780 --> 00:38:14,260 They got it. 640 00:38:14,260 --> 00:38:15,000 Wow. 641 00:38:15,100 --> 00:38:15,600 They got it. 642 00:38:15,620 --> 00:38:16,620 Congratulations. 643 00:38:17,320 --> 00:38:18,720 Really nice. 644 00:38:18,720 --> 00:38:19,660 Really nice. 645 00:38:19,660 --> 00:38:20,100 Congrats to shellfish. 646 00:38:20,100 --> 00:38:21,260 Yeah, shellfish. 647 00:38:21,680 --> 00:38:23,540 Advancing in the tournament. 648 00:38:23,540 --> 00:38:30,320 Unfortunately, Pigbuttsad are knocked out of the live CTF tournament, but they had a great run. 649 00:38:30,320 --> 00:38:32,180 Really well played. 650 00:38:33,140 --> 00:38:33,940 That was excellent. 651 00:38:33,940 --> 00:38:35,580 Seeing the template that they brought, too. 652 00:38:35,580 --> 00:38:39,460 You could tell this team really is sophisticated , knows what they're doing. 653 00:38:39,460 --> 00:38:42,880 Good luck to them throughout the entire CTF , too. 654 00:38:42,880 --> 00:38:43,460 Right. 655 00:38:43,460 --> 00:38:44,800 And shellfish , this was great. 656 00:38:44,800 --> 00:38:48,840 Seeing the second attempt for roping there . 657 00:38:49,160 --> 00:38:50,940 Yeah, it's really, really cool. 658 00:38:51,440 --> 00:38:54,540 So that means they will advance on to the next round. 659 00:38:55,240 --> 00:38:57,080 Yeah, this was super fun. 660 00:38:57,080 --> 00:38:58,100 This was great, yeah. 661 00:38:58,100 --> 00:39:00,400 Yeah, thanks for coming on as a commentator. 662 00:39:00,400 --> 00:39:01,120 Thanks for commentating. 663 00:39:01,180 --> 00:39:04,920 And we will go to a short break. 664 00:39:04,920 --> 00:39:06,480 We will be back. 665 00:39:06,760 --> 00:39:08,640 I'm 0xSleep on Twitter. 666 00:39:08,640 --> 00:39:13,260 If anyone wants to talk, I'm Vee on BlueSky. 667 00:39:13,260 --> 00:39:14,780 If anyone's on BlueSky. 668 00:39:14,780 --> 00:39:15,700 So see ya. 669 00:39:15,700 --> 00:39:16,700 Have a good one. 670 00:39:17,080 --> 00:39:20,380 Before I sign off here, just take a quick look at the bracket. 671 00:39:20,380 --> 00:39:24,380 As I said, we had PigBotSAD will be facing Shellfish in the next one. 672 00:39:24,380 --> 00:39:28,860 And then no, sorry, that was just what happened. 673 00:39:28,860 --> 00:39:31,300 Shellfish won against PigBotSAD. 674 00:39:31,460 --> 00:39:32,360 And NorseCode won their match. 675 00:39:32,360 --> 00:39:34,100 So it's Shellfish versus NorseCode? 676 00:39:34,100 --> 00:39:36,220 No, so what's happening is this is the lower bracket. 677 00:39:36,220 --> 00:39:38,020 So you have the upper bracket here. 678 00:39:38,020 --> 00:39:40,020 You have Macaroni versus Hypeboy. 679 00:39:40,020 --> 00:39:42,180 And then you have MMM versus StrawHat. 680 00:39:42,180 --> 00:39:47,400 And the respective losers of those matches will face against Shellfish or NorseCode. 681 00:39:47,400 --> 00:39:48,020 Okay. 682 00:39:48,360 --> 00:39:49,920 So that's it. 683 00:39:50,600 --> 00:39:51,560 Shout out to StrawHat. 684 00:39:51,560 --> 00:39:52,580 Great team name. 685 00:39:52,580 --> 00:39:53,720 Big One Piece fan. 686 00:39:53,720 --> 00:39:55,100 So love to see it. 687 00:39:55,100 --> 00:39:56,540 So who is the next one coming up? 688 00:39:56,540 --> 00:39:58,640 I think we have it's both of those two matches. 689 00:39:58,640 --> 00:40:00,780 Macaroni and Hypeboy and MMM and StrawHat. 690 00:40:00,780 --> 00:40:03,020 I don't remember which one of those we are commentating. 691 00:40:03,020 --> 00:40:05,780 But we will be back here soon. 692 00:40:06,220 --> 00:40:07,620 And yeah. 693 00:40:07,620 --> 00:40:08,220 Have a nice day. 694 00:40:08,220 --> 00:40:08,700 Bye.