Hello, everyone, and welcome to this lesson.
So here we are going to learn about how we can break the root password.
Or maybe you come across a situation in which you just forgot the password for your computer and you
need to log in, or for some reasons, you are locked out of your computer.
So in that case, how are you going to reset your password or how you're going to break in and reset
the password and log in into your computer?
So for that, I'm just going to quickly restart my copy machine.
So this is my machine which has successfully restarted.
I'll hit enter and I'll wait for this to start.
So this is my Linux machine which has restarted.
I'll hit enter and I'll wait for this to go onto the login screen.
All right.
So I think now it is going to boot up onto its login screen and I'm going to show you that I will not
log in with the correct password.
Or maybe I've just forgot my password for some reasons.
My username is root, but the password is incorrect.
So currently I'm typing in the password, which is ABCDE.
That is obviously incorrect password.
So I'll just copy that and I'll paste it over here and try to hit login once more and you can see the
password is incorrect.
Now you may come across these situations in life, but then you now need to go into your machine, but
you don't know the password.
So you're going to reset the password using a technique.
So let's do this.
So for it, you need to restart your computer before restarting.
Here are some steps to reset the root password.
So the first is boot into the grub menu.
So this is basically nothing.
Just do a restart and it will automatically pop up a grub menu which is Grand Unified Bootloader, which
is nothing.
Just the screen which sees you that you need to start the Kali machine.
After that, you have to select the second option and you need to press E, which is you need to edit
in order to edit the boot entry as shown below.
So first, let's do this two steps.
So I'm going to restart the machine and wait for my machine to boot up.
And as soon as we see the grub menu, we press E to edit the entry.
And you can see clearly over here it says G and you grab version 2.04 over here and you can also see
that here there are certain characters in String which are being written.
All right.
So now the next step is to find the keyword, which is Linux and search for r o that is read only and
replace that with read and write.
So let's see where is Linux?
And here it is Linux.
And we can also see that it is written as R o which is read only.
We need to modify that to read.
Right.
This is done.
Next step is find quiet and replace with init bin bash.
So let's just do that.
So here is quite so let's just remove that and we're going to say in it which is initialize and we're
going to say equals to bin bash.
But in the new version of Kali, it has implemented Z search.
So I will just say instead of bash this time bin slash z search, which is the latest shell done now
you need to click F10.
It will save these changes and give a restart to our machine.
So let's wait for this to complete.
And now you will come across a screen on which you need to see that.
Do we successfully have the read write permissions or.
No?
If we have that, that would be awesome.
And now we can reset the password without logging in into the application.
So now we can reset the password without knowing the correct password.
So this is the screen and now here we need to type mount.
So we need to type mount command to check if we have the read write permissions.
It is granted or no so quickly type under and you'll see.
Yeah, we have RW that is awesome.
Now we know we need to reset the password so the command would be passed WD And the username that we
want to reset for.
So it is a route right now.
So I'll choose a new password which is route and again the same password which is route and hit enter
and you can see the password is updated successfully.
Now I need to restart so I will say execute as bin and initialize the run level so it will automatically
restart my computer and now I should be able to reset the password.
So I'll just copy a BCD and paste it over here.
So the new password that I set was a BCD, not root.
So the username is root.
The password is a BCD which was not working before, but it has worked now, which means we have successfully
logged in into our machine with resetting the password from the grub menu.
You can check.
I am the root user currently and we have used the password abcd by resetting it from the grub menu.
I hope you guys understood this.
Thank you.