Narrator: So far in the course, 2 2
we seen a number of methods 3 3
to gain full control over computers. 4 4
So we seen how to do that using server side attacks, 5 5
client side attacks, and how to use social engineering 6 6
to achieve that as well. 7 7
All of the attacks that we did so far, 8 8
we did them inside the network. 9 9
And I chose to do that for convenience. 10 10
That doesn't mean that these attacks only work 11 11
inside the network. 12 12
In fact, all of these attacks work outside 13 13
the network as well. 14 14
The only thing is that you need to configure 15 15
your network in a way to allow incoming connections 16 16
from the internet from outside your local network. 17 17
So you can use beef, you can use the back doors, 18 18
you can use the server side attacks, 19 19
all the tasks that we did so far, 20 20
except for the special cases, 21 21
all the only thing that you wanna keep in mind 22 22
is you wanna configure your router 23 23
to handle reverse connections properly 24 24
and direct them to the kali machine. 25 25
So right now I'd like to focus on that 26 26
and show you how that would work 27 27
and how to configure your router to achieve that. 28 28
So first of all, 29 29
let's have a look on a default network setup. 30 30
So we seen this before we seen a similar diagram. 31 31
And right here you can see that we have the router, 32 32
here we have the clients that's connected to the router. 33 33
And then we have the router 34 34
that is connected to the internet. 35 35
And we mentioned before that all the clients, 36 36
all devices inside the network, 37 37
they actually don't have internet connection, 38 38
they can only access the internet through the router. 39 39
So whenever they want to request something, 40 40
whenever they want to go to a website, for example, 41 41
if they wanted to go to Google, this device would actually 42 42
send a request to the router, 43 43
the router is gonna go to the internet, 44 44
it's gonna get google dot com 45 45
and the response is gonna be sent to the router, 46 46
then the router will forward that response to the device 47 47
that requested it. 48 48
So inside the network, each device has its own private IP. 49 49
So we can see these IPS are written in red 50 50
and these only exists within the network, 51 51
that's why we call them private IPS. 52 52
Because outside the network, 53 53
these IPS are not visible. 54 54
And we can see that the router here has two IPS. 55 55
So it has a private IP in red, which is accessible 56 56
by all the devices in the network. 57 57
And it's only used inside the network. 58 58
It also has a public IP, which I have here in green. 59 59
And this is the IP that's accessible through the internet. 60 60
So this is the IP that Google sees. 61 61
So whenever you actually go to Google 62 62
or to any other website, 63 63
they see an IP address, 64 64
but they won't see your private IP address, 65 65
they'll actually see the IP address of the router 66 66
because the router is the device 67 67
that actually making the request, 68 68
it's not you. 69 69
So all the requests made by all of these devices 70 70
on the same network, they'll all appear as if they're coming 71 71
from the same machine or from the same IP. 72 72
This is again because the only device that has access 73 73
to the internet is the router 74 74
and it's none of these devices. 75 75
Now, let's go back to our scenario. 76 76
So we usually, in most cases, 77 77
or if you think about it in all of the attacks that we do, 78 78
the main thing is we want to get a reverse connection. 79 79
Even when we're using beef, we actually get a connection 80 80
or Port 3000, 81 81
which is the part that beef is working on. 82 82
And when we're using our back doors, 83 83
we actually receive a connection on the port that we specify 84 84
when we make the back door. 85 85
So the things that to keep in mind 86 86
when you want to send that back 87 87
to your to somewhere outside your network, 88 88
the first thing you wanna keep in mind is that 89 89
your local IP is not gonna be visible. 90 90
So what you wanna do is you wanna use the public IP, 91 91
the IP of the router. 92 92
And to get that all you have to do is just go on Google, 93 93
and then type in what's my IP. 94 94
And as you can see, Google is telling me that 95 95
my IP address is this and this IP will actually be the same 96 96
from all machines in the same network. 97 97
Now, I should note here, if I run if config, 98 98
I'm actually connected through a wireless card, 99 99
so I'm not using a net connection, 100 100
I'm using an external wireless card that's connected 101 101
to my home network right here. 102 102
So all the devices in my wireless network 103 103
at home will have this IP. 104 104
Again, that's because they all use the same router, 105 105
they're all connected to the same network. 106 106
So we're gonna use this IP in our back door, 107 107
we're gonna send the back door to a person that exists 108 108
on the internet so exists in here, 109 109
that person is gonna run that back door, 110 110
and that back door is gonna use a reverse connection. 111 111
So it's gonna try to connect back to the router 112 112
on port 8080 for example, 113 113
if we chose that port in the backdoor. 114 114
Once thereafter gets a request for Port 8080 it know 115 115
what to do with it because the router is not actually 116 116
listening to Port 8080. 117 117
And this request will not tell the router 118 118
where it wants to go. 119 119
So what we need to do is we need to configure the router 120 120
to tell it whenever you get a request on port 8080, 121 121
then I want you to forward that port to the kali machine. 122 122
And you can do that for any port you want. 123 123
So I'm just using 8080 as an example. 124 124
But you can do it for any port 125 125
that you're listening on, 126 126
whether it's 8080, 444 or 3000 for beef. 127 127
The main idea is you wanna use 128 128
your real IP outside the network. 129 129
So whenever we run any attack in previous lectures, 130 130
and even in future lectures, 131 131
if you wanna run that attack on the internet 132 132
on someone that doesn't exist 133 133
on your home network, then first of all, 134 134
make sure you use your public IP. 135 135
And make sure you configure your router to forward requests 136 136
on the port that you're listening on to the kali machine. 137 137
And I'm gonna show you 138 138
how to do that in the next lecture. 139 139
Right now, I just want you to get the idea 140 140
of what we need to do 141 141
and how is that gonna work. 142 142
So we're gonna have examples in the next lectures 143 143
and it's gonna become much more clear.