-: Welcome back.
Have you managed to figure out
the command from previous video?
Don't worry if you haven't, since it was a tricky one.
Let us see what the solution is.
So if I navigate to my folder, which we created
in the previous video, we wanted to copy our
'file3.PY' which is our pilot program,
from folder directory, to the desktop directory.
And if you try to solve it but didn't manage to,
you probably went with command CP 'file3.PY' Desktop.
And if I press enter, this command probably surprised you
since it created another folder, or pardon me,
another file in the folder directory called desktop.
This is because it read our command
as if we wanted to copy our file
into another file in the same directory.
And we call that file 'desktop'.
And this is just how the command works.
In order to successfully copy the file
to desktop directory, we must run the command
and specify the full path to the desktop, as well
as the name of the copy that we want.
So it would look something like this.
First we're going to delete this desktop file
since we don't need it.
And then you specify CP 'file3.PY'
and we specify the full path to the desktop
which is slash 'home', slash 'Mr. Hacker',
and then slash 'desktop'.
After it, we also want to specify slash
and type here the name that we want our copy to have.
So let's just call it our 'copy.PY'.
We added '.PY' since it is a Python program.
Press enter, and you will see right away
on the desktop we got our 'copy.PY'.
Now that we got that figured out, let us talk
about the few network commands that we will
use a lot throughout this course.
The most important command we already know is 'IF config'
we use, 'IF config' command to get our IP address.
And what the output of this command is,
is all the network interfaces, as well as
IP addresses corresponding to those interfaces.
If I run 'IF config', oops,
we get command not found, so we must run 'sudo',
'IF config', press enter.
Then we enter our password,
and here I have a few interfaces.
So let me enlarge the terminal
so we can see entire command.
Let's just fully enlarge it,
and run the command once again.
And by the way, you can navigate to the previous
commands using upper and lower arrow, so I can
navigate between all the commands that I ran previously.
And here is 'sudo IF config',
and this is the output of my
'IF config' command. For you,
this will probably be different.
Here I have 'ETH0' interface,
which is my cable connection
and it has an IP address of 192.168.1.12
And I can also see the loop back interface
which is this 'LO', which all of us should have
and it'll be an IP address or 127.0.0.1
which is also a local host IP.
For this course, we will usually be interested
in this 'ETH0' IP address.
If you have another interface called differently
that is also fine.
You could have a different named interface if you
for example, are connecting over wifi, this IP address
that we get right here, it's called local IP address
which means it only works inside
of our network to communicate
with other devices that are also inside of our network.
There is also something called public IP address
which we are going to talk about later in the course.
For now, just remember that
'IF config' outputs local IP address as well
as our network interfaces.
Another thing we can get from 'IF config'
is our MAC address for a specific interface.
So for the 'ETH0' interface, here is my Mac address.
And what Mac address is,
is a unique identifier for every device.
Unlike local IP addresses that could be the same
in different networks for example, it is a great possibility
that you also have the IP address starting
with one 192.168.1.
While the Mac address is unique
for every device in the world.
And in case you're new to all of this
and don't have much previous experience
with Mac addresses and IP addresses,
you might be asking why do we need both of them?
Well let me explain like this.
Mac addresses are unique and usable
in communications with your neighbor machines,
or simply with machines that are on your network.
While IP addresses are used to communicate
over internet and they can also change.
Remember it like this,
Mac address tells you who you are.
IP address tells you where you are.
So that is the 'IF config' command.
And now that they think of this 'IF config' command,
there is one more important command that I didn't show you
and that you will use a lot, which is 'sudo'.
Remember we used it with 'IF config'.
Now 'sudo' is not the part of the 'IF config' command.
It is just a command that we use
once we want to execute something as a route user.
And just to remind you, our route user
is something like an administrator.
It has highest privileges above all other users.
With route user, you can execute any commands that you want.
For example, once we ran this, 'IF config' command
it told us command doesn't exist.
If I just type, once again 'IF config'
it'll say command not found.
But after using 'sudo' 'IF config',
we managed to execute it.
That is because 'IF config' command must be ran
with route privileges in order for it to execute.
Throughout this course we will
encounter many programs and many commands
that will require 'sudo' in order to run.
And sometimes there could be multiple commands
at once that we must execute as a route user.
There is one called tricks
so you don't have to type 'sudo'
before every command is to run
at the beginning 'sudo' and
then 'sudo' you press enter.
And if you're running 'sudo' for the first time inside
of one terminal session, it'll ask you for your password
and then it'll log in into the route terminal.
So everything you run from now on
you will run as a route account.
Right now I no longer need to specify 'sudo' 'IF config'.
I can just specify 'IF config' and it'll not tell
me command not found, it'll execute it since I am
a route user as it says right here,
it is no longer 'Mr. Hacker', it is now route.
If you want to exit out of this route terminal
you simply just type 'exit'
and it'll go back to your 'Mr. Hacker' terminal.
Now this can also be applied to files.
Some files might be created only for you're account to edit.
For example, if we run the command
'sudo touch file 1', we press enter.
And if we, for example, type 'sudo nano file 1'.
Type here, 'hello there'.
We control O to save and then control X to exit.
We won't be able to edit this file
as a normal user without the 'sudo'
command or without the route account.
If I lower this terminal, here is our 'file 1'.
And the reason why we can't edit it is because
this actual file right now has been opened and edited
with route privileges and once we saved it,
we saved it as a route, so right now,
if we try to nano it, it'll tell me file is
unwritable, which means I cannot write anything.
Well, I mean I can, but if we try to save it
it'll tell me right here, permission denied.
So let's close this and open terminal once again.
However, if you go as a route account,
'sudo nano file 1' and we type our password.
Now we can type anything we want.
Just one second, It seems that we opened the wrong file.
This is the file one that we created from the previous
video that says today's a really good day.
And to go to the file one, that route account
created, I believe it is one directory back.
Or let's just go to the 'sudo' user type enter
'CD Mr. Hacker CD desktop cat file 1'
Nevermind, since we can't really find it,
let us just create another file.
Just make sure you go to the route account of the terminal
and then type 'nano test file'.
And once you type 'nano test file' here,
type hello there, save this,
exit the route account and if I lower terminal
right now, we will see this test file right here
on our desktop, that it also has this lock right here.
This means we as a normal user cannot edit this file.
We first need to go to desktop directories.
So let's go to the 'Mr. Hacker' and then desktop.
And we 'nano test file'.
It'll tell us once again, file is unwritable
Only route account can edit it.
And this is something you will encounter a lot.
So it is really important, next time you see
either something like command not found,
or right protected file, or this requires route privileges
just know that it needs to be ran with 'sudo'.
Alrighty, so with this we finished our small crash course
for Linux and I would advise you to practice
a little bit with the commands we learned,
and also explore Kali Linux Operating system a little bit.
Go to different directories, see what it all has.
But be careful not to delete some important files.
Okay, now we are ready to finally go
into the process of penetration testing.
Hopefully you are excited,
since this is where the fun starts.
Let us see how to perform the first phase
which is information gathering.
See you there.