-: Okay, now let's have another example
on who can people to BeEF when
they exist outside our network.
So again, we're going to have the
example, I guess, the same Windows
machine, that's in a completely
different network, and we'll see
how we can hook that machine to BeEF.
So, first of all I'm going to start BeEF.
Just one click right here and that will start BeEF for me.
And I'm going to login.
Username is BeEF and password is BeEF as well.
And we're logged in.
Now, we're going to use the same
basic hook method that we did before.
So, in that method we need to get
the script code right here, which is this.
I'm going to copy that and we did
this before so again I'm going
to do it a little bit quickly.
And we place that in our Apache web server.
So place it in an HTML page and
that was in always our Apache web home directory is
/var/www/html/
and I'm going to open my index file.
I'm going to open it with the text editor.
And I'm going to paste this code
right here that I got from BeEF.
And the only thing that you want
to change -- all this is okay -- the
only thing that you want to change --
as I said before -- anywhere that
we used to use our normal IP we're
going to use our external IP.
So that people when they try to
connect they'll actually be able to find our computer.
Because if we use internal IP they won't be able to see it.
So again, I'm going to use the
IP that we see on Google when
we type in "what's my IP?"
And that's it.
I'm good to go so I'm going to save this.
Quit it and now I need to enable port 3000.
Which is the port that BeEF works on.
As you can see, we can see that it uses port 3000 here.
So I need to tell the router again,
in the IP forwarding settings,
I need to tell it to forward any
request that you get on port 3000
to my [Cali?] machine which is at 192168011.
I'm going to save that and that's it.
That's saved.
Now, we're going to go to the Windows machine.
We're going to go to our website.
Which is my--basically my IP, my
external IP and we're going to go.
It's going to run index [through?]
HTML automatically because the file is called index.
So all we have to do is just put
the IP of the network that [Cali's?] connected to.
So, what we need to use is this IP address right here.
Which is 89100145189 and we should
be hooked to BeEF as soon as we browse through that IP.
So, let's see what happens.
Okay, now let's go to BeEF and
as you can see we got a Window's
machine hooked and it's using
Firefox 50 and now we can run
all the commands that BeEF allows us to run.
So, let's just throw on alert and see if it works.
And it just says, "BeEF Alert Dialog."
I'm just going to execute it just
to make sure that everything is working properly.
And, as you can see we managed
to hook, and -- a machine that
exists in a completely different network.
And again, to confirm that I'm
going to go on Google and I'm going
to look for "what's my IP?"
And as you can see the IP is completely
different to the IP that's in this machine.
So, again, all we have to do is
use the external IP address whenever
you're sending it outside the network.
Use the IP that you see when you
type in "What's my IP address?"
When you're listening on your
own machine use the local IP and
make sure you configure the router
to redirect the port that you're
listening on to the [Cali?] machine.
To the IP address -- to the private
IP address of the [Cali?] machine.
An alternative to using IP forwarding
you can set the [Cali?] machine as a DMZ host.
Now, not all routers support DMZ.
That's why I didn't show it from the start.
But if it supports it you can use it.
And what [DMs] does is it's basically
IP forwarding but it forwards all ports.
So, if you put the IP address
here, of the [Cali?] machine in
here, what the router's going
to do anytime it gets a request
for any port -- any port at all --
it'll forward that request to
the [Cali?] machine regardless of what port it is.
So with port forwarding, you actually
select which ports you want to forward to [Cali?].
With DMZ it will forward all the
ports to the IP that you put in here.
Now again, both of these methods
can be used to allow devices on
different networks to access your
computer so you can receive connections,
you can allow them to access a
website -- if you are hosting
a website on your web server --
you can allow them to access fake
websites, you can allow them to
access BeEF, the hook, anything.
Anything where you are listening
on a port you can use this method
to allow people to access it if
the people exist on a completely
different network than your own network.