Hi, within this lecture, we're going to go into the level 24 and so much more if we have time.
So far we are in the level 23 and again, I believe this is about crohn jobs.
One more time.
As you can see, it asks us to go into the crown.
As you can see, there is nothing over here.
So I'm going to go into that secondees and see what this is about.
So I'm going to run the Lesli and here we go.
Now, we have covered the Bendit 22 23, and now we want to take a look at the current job and the 24.
So I'm going to cut this out.
I'm going to say Cat Crohn job and the twenty four.
And here you go.
We have again Abeche script over there.
So we want to see what's inside of this one.
So I'm going to copy this.
OK, user bin Cronje, the training for that S.H. and I'm going to get this out to see what it contains.
And here we go again.
This is a bad script.
We see the Shabangu, we see some kind of variables and all other commands.
Now, this level requires us to create our own first shell script.
And this is a very big step and we should be proud, apparently, of ourselves when we beat this level.
So keep in mind that your script is a real once executed, so you may want to keep a copy around.
So this is good.
So we're going to write apparently our first script.
So you don't have to know anything about your script.
Think I believe in order to complete this because scripting is kind of running commands in the terminal
in a way, but it's much more complex if we actually want to do more complex things.
But we're going to keep it simple anyway.
So let's try to get take a look at this and try to understand what it's doing over there.
So, again, we have a my name, which is the Who Am I, which has been the training for at this point.
Right.
If we run, who am I?
It will give us the bend.
Twenty three, but it will be run by the bandit.
Twenty four.
So my name will be Bandit twenty four in this case.
Then we're going to go into VR Spool and Bandit twenty four.
OK, and we can try to squeeze into that and try to run all of those things.
So let me go into Raspal and bend it.
Twenty four not c.v but KD.
Let me come over here and let me try to run SLA.
Here you go.
We cannot see what's inside of this because it's, I believe it can be read by the Bendit 24 VR, the
twenty three at this point.
So far so good.
It's actually it's not good because we cannot see what's inside of that folder.
So we're going to have to think about it a little bit.
Now we're going to say echo executing and deleting old scripts, inverse spool, my name.
So I believe we're going to execute some of these scripts and then we are going to delete it and we're
going to see if that's really the case.
So we have a for loop over here.
So if you know Python, then you know what a for loop is.
It's kind of a loop.
It's actually literally a loop that goes on and on until a condition is met.
OK, so in this case, for I instar means just for the old scripts or old files in that folder, ok,
for I in Stardust's are so I will stand for every individual file on that folder.
OK, so for every individual file on that folder, where are you going to do some things.
So this is the thing that we're going to do.
So again, I sense for the individual files in that folder.
So over here it checks something.
OK, so this is the if block.
If the condition is met, then it's going to execute the following comments.
And in this case, I believe it's checking to see if it's a file.
And then it says that the owner of that file, if the owner of that file has been to twenty three,
then it's going to do something, OK, so it's going to give us a timeout, I believe, for sixty seconds,
and then it's going to exit.
You that file, as you can see, this is for executing again, Dash, that I means that that means running
and the dollar sign, I sense for the individual file in that folder.
So what it's basically doing over here is that deleting that file.
So it's going to find every file in that folder.
OK, basically it's going to execute it and it's going to delete it.
So what we know over here is that if we can know what's going to happen in that folder, what's going
to be placed in that folder, it's going to be executed and then it's going to be deleted.
So I believe it's asking us to write a comment or write the best script to put in that folder.
If we can write that folder, obviously, if we can put something in that folder, it's going to be
executed and then it's going to be deleted.
I don't care if it's going to be deleted or not, but if I can execute something on that folder, it
will be executed as if it's appended 24, OK, because it's the current job of Bendit 24.
And I believe we can write something over there because it's checking to see if the owner is been 23,
even though it's a bandit 24.
So I'm going to copy this Shabangu.
OK, I'm just going to start writing my own best script and show you what I mean, because it's going
to take some time, I believe.
OK, yeah.
I cannot type anything right now.
I believe I lost my connection.
OK, I'm just going to close this down and just S.H. into that thing one more time.
We already have the password over here.
I just have to just take the password and connect it one more time.
So if you come across in a situation like this, you're allowed to have the passwords.
You can connect it one more time.
So let me try one more time.
Pastie password.
I believe we couldn't get it in a proper way.
Let me try one more time.
I'm going to say copy selection.
I'm going to come over here and say page selection.
And here you go.
We are inside of Bendit.
Twenty three.
So I'm going to code into that second the one more time.
OK, so we have the kronur Bendit twenty four.
So if we get this banded twenty four we will see the S.H. file.
I'm going to catch this one more time in order to see what's going on over there.
So far so good.
So I'm going to actually try to write my own my script right now.
So after writing my own bad script, I'm, I'm just going to try and put it into the target folder.
OK, so I believe we can not see the Bendat Pass at this point.
So if we try to go into Bendit twenty three, it will be displayed to us.
But if we go to bed at twenty four, it won't be displayed to us.
But if we can actually run this comment with our best script, it will be executed and we can get the
password back because it will be executed as Bendit 24.
Right.
All we have to do is just make sure we put it in the wire spool, then the 24 folder.
So what we're going to do, we're going to create a bad script.
So let me try to create a best script in the TMP folder because we have write permissions over there.
If I run, unless there is nothing over here, I'm just going to make a folder called Dutil.
OK, you can create a folder you want under temp directory.
And over here I'm just going to try and write some file, write something like kronur or best script
file.
I'm going to use Nano if we have an over here.
So let's try and use Nano.
I'm just going to say test that as H OK, Nano test out S.H. so you can just name it anything you want
and it gives us this error, permission denied and it takes us to something like this.
So what is that.
I'm going to exit out of that by Hidden Control X.
Let me try some other name over here.
My script out as H so here you go.
I believe Testator Assange was taken for some reason.
OK, let me try to save.
Control or enter and control, lax control or enter and control X, but we cannot override that, we
cannot save it for some reason I'm going to name it my daughter's age.
I'm going to say yes, but yeah, here you go.
We cannot do anything with Nano for some reason.
So let me try to create another file.
Maybe there is something wrong with Nano.
I don't know.
Maybe we can use something like Vem.
But if you haven't worked with women before, it might be hard for you to keep up.
Maybe we can do something else like just echoing.
Just echo something into some file.
Right.
Let me go into Tempy folder.
Let me go into let me create another folder like I tell one, two, three or something like that, OK?
And maybe there is something wrong with that specific folder.
I don't know.
I'm just trying.
Let me go into two, one, two, three and let me try to run a less.
Yet there's nothing wrong over here.
I'm just going to go for NENO one more time and try if this works or not.
Nonno, my script that S.H..
OK, no.
Again it says that only unable to create directory if I hit enter it will open, but it won't save anything.
So I believe there is something wrong with Nano itself.
So what should we do.
We should go for something else then nano again.
We can go for them or we can go for anything else.
Like just echo the comments into a file.
First of all, we need to know what we are going to be executing in that best script.
Right?
So we're going to execute catting out the result of Bendit past Bendit twenty four.
So let me try to echo test in the my script at S.H. H.
Yeah, I believe this works.
Let me see, let me run Katmai script that S.H. and here you go.
It works so we can echo something.
At least we know that.
Let's try to echo something into an actual script.
OK, into the my script as I h anyhow so I'm going to write test to, into my script that as h and see
if that has been overridden.
So yep.
Here you go.
It works.
Now if I echo some comment into that file and then if I can copy that comment into the wire spool bend
24, it will be executed automatically by the chrome jump.
Right.
That is the logic.
That is what we are doing.
That is why we are doing this.
So I'm going to run code and maybe do the shebang over here, like being Bash.
And we don't actually need that.
Ewbank we don't actually need that line.
Right, because it's just for like syntax purposes.
Let me try to just do it like this and see if this works.
My script that S.H. So that backwords such an OK is for giving a new line.
And if I kept my script, no, it doesn't work.
So what I'm going to do, I'm just going to skip the Bemba's thingy and I'm just going to echo what
I want to echo over there.
So what I want is to have the Shabangu like that, OK, without the end over here.
So let me try this.
No, it doesn't even echo the bank.
So there is something wrong with the Shabangu itself.
So we can just skip that line and just try like this cat at Banded Pass, OK, and pass Bendit 24 and
later I'm going to save this output into somewhere that I can actually read.
So I'm going to save it in two to one to three and test or something like Password-Protected or something
like that.
OK, so if we can actually see this, let me try to get my script out.
S.H. Nope, it didn't actually run, but we haven't saved it into the my script that I say.
So we have to just make sure that we save it into my script that h OK now if we try to get my script
that age.
Here you go.
Finally we have.
I have something in my script that S.H., which admittedly Shabangu, but I believe it won't cause any
problems.
So if we can make this run by Bendit 24, it will just read the password of the Bendit 24 and it will
just save the output in the TMP folder under until one, two, three folder in the password that texte.
So I'm going to change the permissions for that file to see Mode 777 in order to make this executable
because we want it to be executed OK by anyone.
We don't care at this point.
It will be deleted anyway eventually.
So the result will be saved in this folder actually in the password that the next day.
But we don't have anything such as password that texte.
So I'm going to create that, create that file.
I'm going to say Tajh password that you see, it will be over here right now.
If you catch this, you won't see anything because it's nothing there.
But after it got executed, it will be there.
But in order for this to work, I believe we have to make sure that password that can be overwritten
by anyone.
So I'm going to change the permission to seven seven seven to password data.
Sixty to just to make sure.
OK, so I'm going to copy my script that S.H. to the target folder, which is if you remember it, it's
VAR Spool Bendit 24 like that.
So far so good.
So here you go.
Now what we should do, we should wait for a minute.
Remember that cron job.
I believe it was getting executed that every six seconds.
I'm not very certain about that.
Maybe we can take a look at chrome tabs or something like that.
But again, we can just wait for a minute and see if we get the result in the TMP folder.
Anyway, after it's executed, it's going to write this into the password data.
So I'm just going to get a password that the ANC forget the result right now.
Here you go.
We already have it.
So it got executed.
So far, so good.
So I believe this is the password for the level twenty four.
So I'm going to come over here and know the password.
I'm going to just paces over there and this will be level twenty four.
So great.
I hope you get this.
So it was very interesting and it was actually very fun for me.
So I'm going to come over here and say Bendit twenty four and try that password and see if that was
the right one.
So here you go.
Paste selection and hit enter and we are inside of Bendit when for grades.
So it has been a long journey for us, going from twenty three to twenty four.
So we're going to stop here and continue within the next one.