1 00:00:00,690 --> 00:00:07,890 Hi, within this lecture, we're going to continue our bandit's Capture the Flag series over here, 2 00:00:08,190 --> 00:00:12,920 so we're currently banned at seven and we want to go to the Bendit eight. 3 00:00:13,290 --> 00:00:14,330 And here you go. 4 00:00:14,370 --> 00:00:23,370 We have the password for the next level stored in the data that texte and it's next to the word Milliot. 5 00:00:23,760 --> 00:00:25,490 So let's see what it means. 6 00:00:25,950 --> 00:00:28,140 It's next to the word millionth. 7 00:00:28,380 --> 00:00:36,330 OK, so I'm going to come over here and just take a look at it and then figure it out, because as you 8 00:00:36,330 --> 00:00:43,470 can see for the command tips, we have a lot of things going on over here, like Rapsody, unique strings. 9 00:00:44,280 --> 00:00:48,090 So I believe it's getting harder at this point. 10 00:00:48,630 --> 00:00:55,650 So let's try to figure this out and we will see what kind of tools that we can use for this lecture 11 00:00:55,650 --> 00:00:58,120 or for this challenge as well. 12 00:00:58,350 --> 00:01:04,410 And if you don't know what all of those things do, we're going to just take a look at them once we 13 00:01:04,620 --> 00:01:06,750 need them one by one. 14 00:01:06,780 --> 00:01:08,220 OK, don't worry about it. 15 00:01:08,730 --> 00:01:16,350 So I'm here in the Bend seven, and obviously I lost my connection for some reason. 16 00:01:17,380 --> 00:01:21,030 Thankfully, we have this password saved over here. 17 00:01:21,210 --> 00:01:26,610 So I'm going to try to exit out of this one or just close it down and open a new terminal. 18 00:01:27,240 --> 00:01:34,470 And I'm going to connect it one more time, I believe, because I cannot write anything right now. 19 00:01:34,650 --> 00:01:39,280 So if you come across in a situation like this, don't worry, it happens. 20 00:01:39,750 --> 00:01:48,860 So let me just close this down and come over here and try to assess each into this file or the server, 21 00:01:48,900 --> 00:01:49,440 OK? 22 00:01:49,890 --> 00:01:53,940 And I'm going to write SNH Bendat seven. 23 00:01:53,940 --> 00:01:59,550 And the hosts should be let me just get the host from level seven. 24 00:02:00,210 --> 00:02:03,870 Bendat lapse over the wire that arc here go. 25 00:02:03,880 --> 00:02:14,280 Let me copy this one and pasted over here and the port was twenty to twenty and let me get the password 26 00:02:14,280 --> 00:02:17,760 from our Bendat folder over there. 27 00:02:17,910 --> 00:02:21,300 Let me get the password that you see and here you go. 28 00:02:21,450 --> 00:02:23,250 This has been the seven password. 29 00:02:23,850 --> 00:02:27,360 Let me copy this and let me come over here and paste this. 30 00:02:27,690 --> 00:02:30,510 And finally, we're inside of the Bendat seven. 31 00:02:31,230 --> 00:02:35,250 So let me go back to Bendat seven to Bendit eight tips. 32 00:02:35,820 --> 00:02:38,120 So let me try to run Al-Saleh. 33 00:02:38,220 --> 00:02:38,730 Here you go. 34 00:02:38,730 --> 00:02:45,300 We have the data that taxe, but as you can see, it's it's actually a very big file. 35 00:02:45,720 --> 00:02:54,600 OK, I believe this is for Mac and if it only contains text's or string, something like that, we have 36 00:02:54,600 --> 00:02:56,400 a lot of things going on over here. 37 00:02:56,400 --> 00:02:57,840 Let me try to get this. 38 00:02:58,080 --> 00:02:59,010 And here you go. 39 00:02:59,010 --> 00:03:04,620 We have like thousands or maybe even millions of data over there. 40 00:03:05,070 --> 00:03:12,180 So it will be very hard to find the password because as you can see, it's all hashed. 41 00:03:12,180 --> 00:03:14,640 We have a lot of hashes going on over here. 42 00:03:15,000 --> 00:03:16,860 So we have to find something. 43 00:03:17,370 --> 00:03:20,400 Of course, we can try to just find it right. 44 00:03:20,880 --> 00:03:25,080 We have a find in the terminal as well. 45 00:03:25,080 --> 00:03:33,180 We can try to search for millions, but we cannot see it because I believe for some reason we cannot 46 00:03:33,180 --> 00:03:36,630 see the whole data because it's too big. 47 00:03:36,810 --> 00:03:43,140 Maybe we didn't even get the whole response from the server for some reason, OK, because it's too 48 00:03:43,140 --> 00:03:43,560 big. 49 00:03:43,890 --> 00:03:51,810 So we actually want to specifically get the line that has the millions inside of it. 50 00:03:52,260 --> 00:04:00,090 So in order to do that, maybe we can just cut this out or we can use strings in order to find the related 51 00:04:00,090 --> 00:04:00,780 data. 52 00:04:01,260 --> 00:04:04,790 OK, so we have the GRAP, we have the strings. 53 00:04:04,980 --> 00:04:06,750 Let me show you how strings works. 54 00:04:06,750 --> 00:04:16,740 So if you write strings, that data that we can see the actual output one more time, but by using strings, 55 00:04:17,010 --> 00:04:25,350 we can handle these lines individually so that we can use this Peiping side. 56 00:04:25,680 --> 00:04:32,610 So if you haven't used this before, you can do this with alt and dash or option or dash Olmec. 57 00:04:33,510 --> 00:04:41,640 This means that the left side of the left side of the pipe is the ultimate OK. 58 00:04:41,730 --> 00:04:49,560 And we are taking this string data, the text output, and we are trying to give this to input of the 59 00:04:49,560 --> 00:04:51,960 right side of the piping side. 60 00:04:52,350 --> 00:04:59,010 So whatever we write at the right side of the piping side will be taking the input from the left side 61 00:04:59,010 --> 00:04:59,520 of the pipe. 62 00:05:00,540 --> 00:05:08,010 So basically, we're getting this data from the strings data that the next comment and giving this as 63 00:05:08,010 --> 00:05:14,160 an input to the next comment like crap comment that we're going to be writing. 64 00:05:14,370 --> 00:05:18,590 OK, so GRAP is actually for grabbing something. 65 00:05:18,600 --> 00:05:22,650 So we are trying to get something out of this string's data. 66 00:05:23,160 --> 00:05:27,540 OK, we generally use these internal comments as well. 67 00:05:27,810 --> 00:05:34,140 So what I'm trying to do over here, I'm trying to get the strings data that text and I'm giving the 68 00:05:34,140 --> 00:05:37,080 output as an input to the grep comment. 69 00:05:37,380 --> 00:05:45,120 And inside of that input, inside of the whole output, we are trying to grab the millionth strings. 70 00:05:45,720 --> 00:05:47,030 So here you go. 71 00:05:47,130 --> 00:05:48,930 Now we have the password. 72 00:05:49,230 --> 00:05:55,740 As you can see, it's relatively easy if you know how to use GRAP or if you know up to your strengths. 73 00:05:55,860 --> 00:05:56,360 Right. 74 00:05:56,790 --> 00:06:01,280 So let me just save it over here as level eight password. 75 00:06:01,770 --> 00:06:08,580 I'm going to save this and exit out of that one and I'm going to exit out of this one as well in order 76 00:06:08,580 --> 00:06:10,020 to assess a gene to Bendat. 77 00:06:10,020 --> 00:06:11,810 Seven and eight I believe. 78 00:06:12,330 --> 00:06:12,600 Yeah. 79 00:06:12,600 --> 00:06:13,010 Here you go. 80 00:06:13,010 --> 00:06:13,980 Abandoned eight. 81 00:06:14,770 --> 00:06:23,820 So let's go to the Bendat eight and let's try to paste this password over here and try to connect to 82 00:06:23,820 --> 00:06:24,830 the Bendat eight. 83 00:06:25,590 --> 00:06:33,240 So let me go to the tips and see what we have to go from the Band-Aid to Bendit nine. 84 00:06:33,930 --> 00:06:38,430 So the password again for the next level is stored in the data that texte. 85 00:06:39,000 --> 00:06:47,610 But this time this is a relatively interesting this is the only line of text that occurs only once, 86 00:06:48,120 --> 00:06:51,960 only line of text that occurs only once. 87 00:06:52,140 --> 00:06:55,470 So I believe we have a lot of things going on over here as well. 88 00:06:55,480 --> 00:07:01,740 We have a lot of strings or a lot of texts and they occur multiple times. 89 00:07:01,740 --> 00:07:06,900 But there is only one text that occured only once and we have to find it. 90 00:07:07,320 --> 00:07:12,170 And it's it's actually very good to solve this problem. 91 00:07:12,330 --> 00:07:14,760 It's kind of an algorithm problem as well. 92 00:07:14,770 --> 00:07:19,350 We are going to need to sort this out in an efficient way. 93 00:07:20,310 --> 00:07:21,250 All we have to do. 94 00:07:21,390 --> 00:07:24,630 Let me just check this out and see how it looks like. 95 00:07:25,080 --> 00:07:30,840 So we have a lot of hashes over here and I believe there are a lot of multiple hashes. 96 00:07:31,140 --> 00:07:38,400 So we have duplicates or I don't know, maybe Ithaca's more than once or more than twice. 97 00:07:38,670 --> 00:07:39,360 I don't know. 98 00:07:39,570 --> 00:07:44,580 But we have to find the ones that is not a duplicate of anything, OK? 99 00:07:44,580 --> 00:07:49,350 We have to find a unique value over here and we have a lot of tips over there. 100 00:07:49,350 --> 00:07:54,770 We can use strings, we can use grab one more time, but we see unique over here. 101 00:07:55,140 --> 00:08:04,770 So this command is actually finding a unique, unique element or unique text inside of a collection 102 00:08:05,250 --> 00:08:11,000 so we can use this unique comment in order to find the thing that occurs only once. 103 00:08:11,640 --> 00:08:15,090 Let me try to see Unique Dashty help. 104 00:08:15,660 --> 00:08:16,690 And here you go. 105 00:08:16,980 --> 00:08:18,600 Unique works over here. 106 00:08:18,930 --> 00:08:24,510 So we are certain that we can use the unique and as you can see, there are a lot of parameters like 107 00:08:24,510 --> 00:08:25,260 count. 108 00:08:25,620 --> 00:08:27,570 We can use this. 109 00:08:27,570 --> 00:08:37,170 For example, we can use Dachsie in order to see how how many times that text occurs or how many times 110 00:08:37,440 --> 00:08:42,920 that that that string occured in that file. 111 00:08:43,590 --> 00:08:47,010 So this is definitely going to be helpful for us. 112 00:08:47,340 --> 00:08:51,030 We're going to use the C or we can use the other ones as well. 113 00:08:51,030 --> 00:08:55,020 Like this D repeated only duplicate lines. 114 00:08:55,290 --> 00:09:02,220 OK, we can use this as well and we can just save it and compare it with the other file that we have 115 00:09:02,220 --> 00:09:02,850 over here. 116 00:09:03,060 --> 00:09:13,440 But I believe the best way to approach this is to run string's data that texte OK and pipe it to D unique 117 00:09:13,770 --> 00:09:15,990 or pipe it to the GRAP. 118 00:09:16,170 --> 00:09:22,860 Maybe we can just use it with unique and I believe we have to specify the dash C over here. 119 00:09:23,520 --> 00:09:28,950 OK, if we don't do that, C we cannot see the occurrences. 120 00:09:29,910 --> 00:09:38,760 And even though we did that, c as you can see, every line seems like it's used only once, but I don't 121 00:09:38,760 --> 00:09:42,480 believe that's the case since it's not sorted. 122 00:09:43,140 --> 00:09:44,250 It's random, right. 123 00:09:44,640 --> 00:09:47,220 It's not right next to each other. 124 00:09:47,220 --> 00:09:48,870 We have to sort this first. 125 00:09:49,020 --> 00:09:49,430 Yep. 126 00:09:49,440 --> 00:09:49,950 Here we go. 127 00:09:50,160 --> 00:09:51,570 We have the tip over here. 128 00:09:51,840 --> 00:09:57,510 We have to sort data out first so that we can see the occurrences over here. 129 00:09:57,510 --> 00:09:59,450 As you can see, this is now fairly new. 130 00:10:00,190 --> 00:10:09,670 And we have all the duplicate values over here, as you can see, most of the or actually all of the 131 00:10:09,670 --> 00:10:18,790 texts are duplicated or even I believe they are occured 10 times in a row. 132 00:10:19,240 --> 00:10:19,740 Right. 133 00:10:19,930 --> 00:10:27,510 So after we sort this, we can just pipe it to unique and then we can see the occurences over here. 134 00:10:28,120 --> 00:10:28,480 Right. 135 00:10:28,480 --> 00:10:29,340 Here you go. 136 00:10:29,800 --> 00:10:35,890 Now we see all of these lines, OK, you're ten times OK, ten times. 137 00:10:36,640 --> 00:10:40,990 And only one of them is going to be occurring only one time. 138 00:10:40,990 --> 00:10:43,540 And that's the one that we are looking for. 139 00:10:44,350 --> 00:10:50,340 So if you know how to use sort, if you know how to use unique, then it's fairly easy as well. 140 00:10:50,350 --> 00:10:58,350 So I'm going to NENO over here and just save it to over there to the password. 141 00:10:58,360 --> 00:11:06,480 That's Steve and I'm going to exit out of this one to S.H. into into the nine. 142 00:11:06,790 --> 00:11:07,240 Right. 143 00:11:07,240 --> 00:11:08,350 So Bendit nine. 144 00:11:09,190 --> 00:11:12,040 So let me try and see if this works or not. 145 00:11:12,040 --> 00:11:15,760 If this works, we're going to stop here and continue within the next one. 146 00:11:16,030 --> 00:11:21,720 But let's make sure that we found the actual password and here we go. 147 00:11:21,970 --> 00:11:30,860 Now, we managed to find it by using smart and unique and now we know how to use strings, grab sort 148 00:11:30,970 --> 00:11:37,780 a unique and maybe we will use the other ones in the next lecture's let's up year and continue within 149 00:11:37,780 --> 00:11:38,650 the next one.