Hello everyone and welcome to part 19 of my land.
Ethical Hacking course in this part we're to look a different method on how to hook a token machine
to our beef framework.
So this doesn't require the actual user.
So it's a good thing about this method is that it doesn't actually require a user to connect to your
Web site with the script in the hate mail but the index to each demo if you remember correctly we had
to put this inside our index hitched smell that was on our local server.
And when they visit that you are all in this case it was just our IP address then they automatically
were hooked.
But for computers on the same network we can actually use something common in middle F.
And essentially this will just inject the hook dot j ust file directly to their system where they save
the computer it will hook it automatically.
This doesn't require them to visit any sort of Web site they could be browsing and Facebook YouTube
that any news company.
It doesn't really matter should they news websites they will be hooked.
And then you can still use it like normal you can execute commands fake updates make them download your
payload etc..
There's downsides to this though.
There have to be on the same network.
I will show in the future how to make beef work outside of your local network but you can imagine this
being like a public Wi-Fi spot and your own fake access points.
And people can actually then you could use this method to actually hook them without them even knowing
it.
So there's a few things you need and in the terminal.
I've opened up beef so I've got beef and I've logged in.
I've got no online browsers and no offline browsers and all you need to do is type route.
And so route hyphen and this will show routing table and the gateway is the most important parts of
where this destination zero point zero point zero point zero the gateway IP address is important.
So keep an note of.
In this case for me it's 1 9 2 dot 6 8 dot one tenth or two.
We also need the IP of the target machine to target computer.
Now in a situation where you're in a public Wi-Fi spot then you wouldn't be able to go over to that
person's computer and type S.M. day and find out their IP address.
You would have to use something like and map or auto scan which I will show in this course.
But for now we're just going to go to the target machine.
We're going to open CMT and we're going to just get the IP address manually.
So you just type IP config inside CMG and it's right here at the depot Gateway is also displayed so
you can see that the both connectors the same router which is important.
Otherwise it wouldn't work.
So now we've got everything we need.
We got the IP address of the target machine the gateway and we also know our Cally machines IP address.
So I'm just gonna open Terminator and we can actually start with the man in the middle f poisoning or
pee poisoning.
So let's make this a little bit larger so you can actually see what I'm going to type here is I am sorry
not in capitals.
Am I t TMF For man in the middle f haven haven LP hyphen hyphen spoof.
So every command starts with two hyphens.
Apart from this one which is hyphen I had zero because I can't type.
There we go.
Now this could be w land zero few.
It depends on what Wi-Fi card you using.
So if you type I config are you using w land zeros to connect to your Wi-Fi using a wireless card and
extend a wireless cut then you would type it w land zero.
My case I'm using 88 0 so I'm going to type 88 0 here.
It's also wired connection because it's using the host machines wireless card and when use of virtual
machine it uses a breached connection to access a wireless connection between the virtual machine because
virtual machines are standalone computers and it's acting as a separate machine but using the same internal
wireless card.
That's why it's breached.
And that's why it's a wired connection Bill.
The host machine is using a wireless connection so that got 88 area then needs to specify the gateway
the gateway starts with two hyphens then the gateway IP which we just showed you on the CMB it's 1 9
2 1 6 8 dot 1 tender 2.
So we just need to take that 8 1 9 2 1 6 8 dot 1 10 dot 2 then we need to specify our targets or its
targets and the target IP address which was 1 6 8 0 1 10 to 1 2 9 then hyphen hyphen H S T S H S T us.
Then we need to specify all methods and what we want to do with this.
So it's inject because we want to inject a certain code.
In this case it's is javascript.
So it's inject hyphen hyphen J asked Hi from you are L and then it's just a beef or beef hook is a J
ust file called hooked up J.S. so if a goat scroll up on this terminal you can see here it says Hook
on it's this right here in between the two double quotes we just need to copy this and paste it here
then we just need to change the IP so what is this IP you want to get rid of the clothes in brackets
the angle brackets Underwood IP and then type your IP address of the Cally machine so that in my case
it's 1 6 8 1 9 2 dot 1 6 to 1 10 don't want to 8
so now it's going to inject this script javascript directly into their browser while I have a website
they visit so many in the middle F A R piece spoof and then we've got a gateway a target's going to
inject hooked up just click enter now if you get an error saying it's not installed I'm going to show
you something so I'm going to split this horizontally why not just start you need to type apt get install
excuse me man in it's M.I.T. MF man in the middle F so if you click enter it will start fetching the
packets have already installed it obviously because it's rolling copier but you'll just let it install
click white so it could use up the space and that's when you know it's installed now there's a few other
commands there's two more this will prevent any errors from showing off because it's very bugging glitches
and some random errors kind of appear you go to description type them in or copy and paste them into
the your terminal line by line to the first one it's quite a lot it installs everything that's required
for a man and a middle F which is on the Github repository that's in the read me file and then there's
something else called twisted it pip install twisted that will make sure everything which crackly.
So once you've done that I can just close out so that now we can go back to our man in the middle F
so everything settle don't worry about this area if you've got it it's just going to start on a different
IP address and different port so we can go to our target machine and say This person goes to their browser.
They remind their unseen network but this could be a local public Wi-Fi spot and they could go to BBC
Takeda UK.
So they want to see the news to go to BBC Dakota UK.
It works perfectly.
You know I take too many WS so let me move on w and I'll send them to BBC.
That you k now it just take a little bit longer than usual but did you get there even though it doesn't
look like the BBC website.
It's because it's using or Internet bandwidth and so show it doesn't load everything.
But they still get to the Web site.
They could go back to being they could go to any sort of websites and if we go back to our killing machine
you can see here that this is what the man in the middle F is actually injecting.
So that's why it's taking up some of the Internet but bandwidth can reduce the speed.
Hence why it's not fully loading all of the CSX but still works.
There's still got to be BBC time I think oh the Internet's just a bit slow it's understandable for some
public Wi-Fi spots they can still click on this like normal so it can prove it's the actual Web site.
So we'll have a look several reasons why we love Stephen Hawking so here we go.
This is seven reasons why we like him for some reason and we'll go back to our killing machine so as
you can see here starting all disputes so we can leave that ruling and if we go back to our beef you
can see we've got a hook we've got to hooked browsers in fact apologize about that car beep in its own
but we've got to help process the same thing it's because we keep going to different Web sites and it's
just going to keep re hooking.
So what we'll do is we'll just go back to BBC and leave it as that.
So that's just going to take a while to load now obviously because it's taken so long to load.
People might get a little bit suspicious but it still works it still opens they just will think the
Internet's a little bit slow because this has taken its toll on the Internet but we've still got a hook
browser as you can see through BBC docket UK and this is our target machine so we can do some commands.
We'll just do some basic ones like alert
and we'll create an alert box saying sorry you have been hacked obviously I wouldn't say that to the
person but you just let's just execute it and go back to our target machine the sites say sorry you
have been hacked and we'll also take a screenshot of the desktop let's see if spider I actually works.
I'm not sure if this does but if we go execute.
We've got a previous command here that's we execute it and see if it works.
Now if it doesn't then that's because spy die is actually quite shit.
But you can use your payload but you got the idea of essentially hook the browser.
Now we've got full control of the computer once we apply it to pay though.
They download our payload but so many things we can do with this we could steal their information you
just have a look through here fake notification bars make them download certain things we can steal
their credentials so let's just steal some Facebook credentials.
Here we go.
So they might have Facebook opened now if you clever about this you could see that this computer is
talking computer.
If you take a screenshot of spider eye it is a little bit iffy but if it does work for you then you
could see if they're actually logged into Facebook and then you could display this message.
So in a way it is more realistic because if they're on BBC dock in the UK are now actually on Facebook
then this looks a little bit strange.
But we'll type test at gmail dot com password click log in and it steals the credentials.
So we go to the previous command module.
There we go.
So there's the email and there's the password.
So that's it for the video.
That's a man in the middle F P poisoning attack.
It does have its benefits.
Like I've said they don't have to go to hooked browsers or hooked to Web site.
And the only disadvantage is that this will only work on local connections local networks
but that's a.
So if it did help please leave a comment if you stuck with anything.
I'll be happy to help subscribe if you use your content and I will see you in the next video.