Instructor: So far in the course,
we learned a number of methods to gain access to computers.
We learned how to do that using server-side attacks,
client-side attacks and using social engineering.
We tested everything though, within our own network
just to simplify things.
That does not mean that these attacks
only the work inside the network.
In fact, all of them work outside of the network
on the internet.
Even if the target computer is connected to different
networks, or even if it is
in a completely different country.
The only thing is
you need to configure port forwarding properly.
You can do that using the routers settings page
and that's what we're going to focus on in this course.
But you can also achieve the same results
by installing Kali or your tools on the cloud
or using a cloud SSH server or using a tunnel link service
that is designed to solve this very problem.
Obviously, each one of these methods come
with its advantages and disadvantages,
but we're focusing on the first one, because in my opinion,
you have to understand how this method works
before being able to use all of the other methods.
So we're spending four lectures explaining this method
in detail so you can use it with whatever service you want.
Whether you want to use it with BeEF, with Backdoors,
with your own web server or with any other service
that you want to expose to the internet.
And then if you face any limitations
or if you want to learn other methods,
then you can check out the other methods
that I actually covered in various places
that as you can see in here,
I didn't want to cover them all in here.
Obviously, cause this is not a social engineering course,
this is an introductory course that is designed
to introduce you to most hacking fields.
And then if you want to learn more,
you could actually check out the other methods
with the main next method being the one in number four
in here using tunnel link services,
which I covered in my social engineering course.
So check out the bonus lecture for more information.
So first of all,
let's have a look on a default network setup.
So we've seen this before. We've seen a similar diagram.
And right here, you can see that we have the router.
Here we have the clients that's connected to the router.
And then we have the router that is connected
to the internet.
And we mentioned before that all the clients,
all devices inside the network,
they actually don't have internet connection.
They can only access the internet through the router.
So whenever they want to request something,
whenever they want to go to a website, for example,
if they wanted to go to Google,
this device would actually send a request to the router.
The router is going to go to the internet,
it's going to get google.com and the response is going to be
sent to the router.
Then the router will forward that response
to the device that requested it.
So inside the network, each device has its private IP.
So we can see these IPs are written in red.
And these only exist within the network.
That's why we call them private IPs.
Because outside the network, these IPs are not visible.
And we can see that the router here has two IPs.
So it has a private IP in red,
which is accessible by all the devices in the network
and it's only used inside the network.
It also has a public IP, which I have here in green.
And this is the IP that's accessible through the internet.
So this is the IP that Google sees.
So whenever you actually go to Google or
to any other website, they see an IP address,
but they won't see your private IP address.
They'll actually see the IP address of the router
because the router is the device
that's actually making the request.
It's not you.
So all the requests made by all of these devices
on the same network, they'll all appear
as if they're coming from the same machine
or from the same IP.
This is again, because the only device that has access
to the internet is the router.
And it's none of these devices.
Now let's go back to our scenario.
So we usually in most cases,
or if you think about it in all of the attacks that we do,
the main thing is we want to get a reverse connection.
Even when we're using BeEF,
we actually get a connection or port 3000,
which is the port that BeEF is working on.
And when we're using our Backdoors,
we actually receive a connection on the port that we specify
when we make the Backdoor.
So the things that to keep in mind,
when you want to send that Backdoor
to somewhere outside your network,
the first thing you want to keep in mind
is that your local IP is not going to be visible.
So what you want to do is you want to use the public IP,
the IP of the router.
And to get that, all you have to do is just go on Google
and then type in 'What's my IP?'
And as you can see,
Google is telling me that my IP address is this.
And this IP will actually be the same
from all the machines in the same network.
Now I should note here.
If I run, if config, I'm actually connected
through a wireless card, so I'm not using a Nat connection.
I'm using an external wireless card
that's connected to my home network right here.
So all the devices in my wireless network at home
will have this IP.
Again, that's because they all use the same router.
They're all connected to the same network.
So we're going to use this IP in our Backdoor.
We're going to send the Backdoor to a person
that exists on the internet.
So exists in here.
That person is going to run that Backdoor
and that Backdoor is going to use a reverse connection.
So it's going to try to connect back to the router
on port 80 80, for example,
if we chose that port in the Backdoor.
Once the router gets our requests for port 80 80,
it won't know what to do with it.
Because the router is not actually listening to port 80 80
and this request will not tell the router where it wants
to go.
So what we need to do is we need to configure the router
to tell it whenever you get a request on port 80 80,
then I want you to forward that port to the Kali machine.
And you can do that for any port you want.
So I'm just using 80 80 as an example.
But you can do it for any port that you're listening on,
whether it's 80 80, 4 4 4 or 3000 for BeEF.
The main idea is you want to use your real IP
outside the network.
So whenever we run any attack in previous lectures
and even in future lectures, if you want to run that attack
on the internet, on someone that doesn't exist
on your home network, then first of all,
make sure you use your public IP
and make sure you configure your router
to forward requests on the port that you're listening on
to the Kali machine.
And I'm going to show you how
to do that in the next lecture.
Right now I just want you to get the idea of what we need
to do and how is that going to work.
So we're going to have examples in the next lectures
and it's going to become much more clear.