Welcome back.
So we can say that we covered some of the most known commands that are commonly used inside of a terminal,
but what is important for us as penetration testers are also the comments that are more aimed at networking,
for example, throughout the course will constantly be checking IP addresses, whether it being our
IP address or target IP address.
It doesn't matter.
We will check it through the terminal.
The most important comment that we use to do this is called I config.
Now I have config gives us an output of all our networking interfaces as well as their IP addresses.
If they have one, let's give it a try.
So if I open my terminal and I type, I have config.
Usually most of you will get rather the same output.
Now, some of you might have an interface more or less, but usually in clinics we will have these two
main interfaces, H0 and Lobach interface.
Now it is where I connect over the Internet and we can actually find our IP address under the Internet,
Pappe, it's usually going to be in the second row and we can see that my local IP address is one point
to that 168.
That one dot 10.
Now, more about IP addresses you can read from our networking PDF file, where we actually explain
different types of IP addresses, how they look like and between which ranges do they go.
But if you want to check your own IP address or your Celtics machine, you can just type of config comment
and it will be under one of the interfaces.
Usually it will be under zero.
And this is how we actually discover the IP address of our own device.
However, to discover an IP address of another device, such as, for example, an IP address of a website.
Well, we can use different tools for this.
One of the most known one is called Annetts Lookup, but for some of you, the end is lookup.
Tool might not be installed.
And this is a perfect moment to show you how you can install different missing packages or tools with
the help of terminal.
So let's first clear our screen and install our next look up to.
The command that we usually use to install a package or a tool is called APT get installed after Apte
get installed comes the tool.
In this case, since we wantonness, lookup and lookup comes in a package called DNS utils, we want
to type Atget instant DNS utils.
Now, keep in mind that these commands must be ran with the privileges, at least in this current version
of Linux.
So let's add pseudo before the entire comment and let's press enter.
It will ask us for our password or just put it right here and it has finished.
And there are two outputs that you will get, either it will install the tool or you will get the similar
output to mine right here in case the tool is already installed, which in my case, it is already installed.
So now that we have it installed, let's try to run it, let's say we want to discover one of the IP
addresses of Google, we can type and look up and then Google dot com.
We press enter and in less than a second we'll get an output.
You can try this on any website in order to get their IP addresses or one of their IP addresses, which
is the case that we got right here.
So we performed and spoke up on Google dot com.
It gave us the output that the name that we search for is Google dot com and that the IP address is
this one right here.
Now, this is not the only Google address.
This is just one of them.
So you might get a different response.
It might be that if you scan this multiple times during the day that you will be getting a different
IP address for Google.
You can also do something like this for Facebook or any other site whatsoever.
And you will be getting their IP address as well as their IP six address that we can see right here.
OK, awesome.
Now, same thing that we did right here.
We can do with the command called host, for example, if I type host.
But let me just clear the screen first.
Host, Google dot com.
It will give me a slightly different output, but more or less, it gives us the same thing as we can
see, it gives us the IP address of Google and we can already see that it is different than the previous
one.
This is the IP before address we got for Google IPV six address that we got for Google is this one.
And we also get by which domain our mailing services handle.
OK, this is how we can discover an IP address of a website, but let's say that you want to, for example,
discover IP addresses of all the devices that are online inside of your network.
For this, we're going to go a little bit more advanced and touch on a tool called Net Discover.
Now, this tool will also mention during the course, but let's just take a peek at it right now.
It should be installed in Caledonia's by default, but if it isn't, you can use the previous command
of cover it, which is apt, get installed to install net discover, too.
Now, in order to run it after you have it installed, all you have to do is type net discovery.
But once again, this being a tool that requires pseudo, we must add pseudo prefix to our comment if
I press enter.
Well, that's it now we just leave it for a couple of minutes, it will scan all ranges of local IP
addresses until it gets to your network range.
Once it gets there, it will output all active IP addresses that are on your local network.
All right.
You can say that we just covered our first useful tool.
Nonetheless, you get the point, we have many useful comments and tools that we can run inside the
terminal and during the course we will discover much more that you will use a lot.
My advice would be that you spend a couple minutes every day practicing these comments that we covered,
as well as researching some new comments that might interest you.
For example, you can say, hmm, I wonder how I can discover what version of Linux am I running?
Then you Google that exact question and you should find the comment.
You name Desh are for discovering Linux kernel version.
And let's just give it a try just for fun.
You can see these are all the active devices on my network so we can control see this.
We no longer needed to scan the network and to discover the kernel version of Linux.
We type the comment unnamed ECHA and we get the output.
And this is how you learn anyway.
If you have any questions regarding terminal or the comments that you covered, feel free to ask.
In the meantime, we are one step closer to our goal of becoming a penetration test.
Let's continue to the next lecture.