Hi, within this lecture, we're going to continue our bandit's Capture the Flag series over here,
so we're currently banned at seven and we want to go to the Bendit eight.
And here you go.
We have the password for the next level stored in the data that texte and it's next to the word Milliot.
So let's see what it means.
It's next to the word millionth.
OK, so I'm going to come over here and just take a look at it and then figure it out, because as you
can see for the command tips, we have a lot of things going on over here, like Rapsody, unique strings.
So I believe it's getting harder at this point.
So let's try to figure this out and we will see what kind of tools that we can use for this lecture
or for this challenge as well.
And if you don't know what all of those things do, we're going to just take a look at them once we
need them one by one.
OK, don't worry about it.
So I'm here in the Bend seven, and obviously I lost my connection for some reason.
Thankfully, we have this password saved over here.
So I'm going to try to exit out of this one or just close it down and open a new terminal.
And I'm going to connect it one more time, I believe, because I cannot write anything right now.
So if you come across in a situation like this, don't worry, it happens.
So let me just close this down and come over here and try to assess each into this file or the server,
OK?
And I'm going to write SNH Bendat seven.
And the hosts should be let me just get the host from level seven.
Bendat lapse over the wire that arc here go.
Let me copy this one and pasted over here and the port was twenty to twenty and let me get the password
from our Bendat folder over there.
Let me get the password that you see and here you go.
This has been the seven password.
Let me copy this and let me come over here and paste this.
And finally, we're inside of the Bendat seven.
So let me go back to Bendat seven to Bendit eight tips.
So let me try to run Al-Saleh.
Here you go.
We have the data that taxe, but as you can see, it's it's actually a very big file.
OK, I believe this is for Mac and if it only contains text's or string, something like that, we have
a lot of things going on over here.
Let me try to get this.
And here you go.
We have like thousands or maybe even millions of data over there.
So it will be very hard to find the password because as you can see, it's all hashed.
We have a lot of hashes going on over here.
So we have to find something.
Of course, we can try to just find it right.
We have a find in the terminal as well.
We can try to search for millions, but we cannot see it because I believe for some reason we cannot
see the whole data because it's too big.
Maybe we didn't even get the whole response from the server for some reason, OK, because it's too
big.
So we actually want to specifically get the line that has the millions inside of it.
So in order to do that, maybe we can just cut this out or we can use strings in order to find the related
data.
OK, so we have the GRAP, we have the strings.
Let me show you how strings works.
So if you write strings, that data that we can see the actual output one more time, but by using strings,
we can handle these lines individually so that we can use this Peiping side.
So if you haven't used this before, you can do this with alt and dash or option or dash Olmec.
This means that the left side of the left side of the pipe is the ultimate OK.
And we are taking this string data, the text output, and we are trying to give this to input of the
right side of the piping side.
So whatever we write at the right side of the piping side will be taking the input from the left side
of the pipe.
So basically, we're getting this data from the strings data that the next comment and giving this as
an input to the next comment like crap comment that we're going to be writing.
OK, so GRAP is actually for grabbing something.
So we are trying to get something out of this string's data.
OK, we generally use these internal comments as well.
So what I'm trying to do over here, I'm trying to get the strings data that text and I'm giving the
output as an input to the grep comment.
And inside of that input, inside of the whole output, we are trying to grab the millionth strings.
So here you go.
Now we have the password.
As you can see, it's relatively easy if you know how to use GRAP or if you know up to your strengths.
Right.
So let me just save it over here as level eight password.
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
to assess a gene to Bendat.
Seven and eight I believe.
Yeah.
Here you go.
Abandoned eight.
So let's go to the Bendat eight and let's try to paste this password over here and try to connect to
the Bendat eight.
So let me go to the tips and see what we have to go from the Band-Aid to Bendit nine.
So the password again for the next level is stored in the data that texte.
But this time this is a relatively interesting this is the only line of text that occurs only once,
only line of text that occurs only once.
So I believe we have a lot of things going on over here as well.
We have a lot of strings or a lot of texts and they occur multiple times.
But there is only one text that occured only once and we have to find it.
And it's it's actually very good to solve this problem.
It's kind of an algorithm problem as well.
We are going to need to sort this out in an efficient way.
All we have to do.
Let me just check this out and see how it looks like.
So we have a lot of hashes over here and I believe there are a lot of multiple hashes.
So we have duplicates or I don't know, maybe Ithaca's more than once or more than twice.
I don't know.
But we have to find the ones that is not a duplicate of anything, OK?
We have to find a unique value over here and we have a lot of tips over there.
We can use strings, we can use grab one more time, but we see unique over here.
So this command is actually finding a unique, unique element or unique text inside of a collection
so we can use this unique comment in order to find the thing that occurs only once.
Let me try to see Unique Dashty help.
And here you go.
Unique works over here.
So we are certain that we can use the unique and as you can see, there are a lot of parameters like
count.
We can use this.
For example, we can use Dachsie in order to see how how many times that text occurs or how many times
that that that string occured in that file.
So this is definitely going to be helpful for us.
We're going to use the C or we can use the other ones as well.
Like this D repeated only duplicate lines.
OK, we can use this as well and we can just save it and compare it with the other file that we have
over here.
But I believe the best way to approach this is to run string's data that texte OK and pipe it to D unique
or pipe it to the GRAP.
Maybe we can just use it with unique and I believe we have to specify the dash C over here.
OK, if we don't do that, C we cannot see the occurrences.
And even though we did that, c as you can see, every line seems like it's used only once, but I don't
believe that's the case since it's not sorted.
It's random, right.
It's not right next to each other.
We have to sort this first.
Yep.
Here we go.
We have the tip over here.
We have to sort data out first so that we can see the occurrences over here.
As you can see, this is now fairly new.
And we have all the duplicate values over here, as you can see, most of the or actually all of the
texts are duplicated or even I believe they are occured 10 times in a row.
Right.
So after we sort this, we can just pipe it to unique and then we can see the occurences over here.
Right.
Here you go.
Now we see all of these lines, OK, you're ten times OK, ten times.
And only one of them is going to be occurring only one time.
And that's the one that we are looking for.
So if you know how to use sort, if you know how to use unique, then it's fairly easy as well.
So I'm going to NENO over here and just save it to over there to the password.
That's Steve and I'm going to exit out of this one to S.H. into into the nine.
Right.
So Bendit nine.
So let me try and see if this works or not.
If this works, we're going to stop here and continue within the next one.
But let's make sure that we found the actual password and here we go.
Now, we managed to find it by using smart and unique and now we know how to use strings, grab sort
a unique and maybe we will use the other ones in the next lecture's let's up year and continue within
the next one.