Hello everyone and welcome to part twenty one of my land ethical hacking course.
In this poll we're going to look at DNS spoofing and why it is so interesting and useful for attacking
a computer.
So this falls into the social engineering side of things because essentially the way DNS BFM works is
when a user tries to go to a Web site.
So they go to you URL and Google Chrome or the Internet for example just typed Google dot com.
That is essentially an IP address that needs to be a translation between an IP address and the U.R.L.
itself.
So when you connect to Google dot com or Google Docs you k essentially are just connecting to an IP
address.
And what we can do is with DNS spoofing we can change the IP address that they connect to.
So if we change that IP address we can change it to any single Web site possible.
So when they type in facebook dot com or Radic dot com and they visit Reddit will happen is it redirect
them and they won't even know it because it will still be in the U.R.L. bathroom ready to come.
But what will happen is if we put in our own IP address of our own server then they will be sent to
the and I think you can figure out from there what you can do with it.
Well let's just get started.
If you don't really understand it make more sense throughout this video.
So when open terminal the first thing when I'm going to do is I'm going to start the Apache to server
and if I get the file open for this.
So this is the director of the Apache to server.
So we've got our payloads here but the most important part of this is indexed on each demo.
So when I open it with another application and what I'll do is I'll open it would leave pad and from
the previous videos in this course it's left as my new blog.
But I'll change it now to just add an h1 tag.
And inside this heat one up will not really read it sorry.
So hopefully I'll get the idea of what I'm going to do.
I've got a virtual machine on the Windows 10.
And what we're gonna do is we're going to use my new middle F to actually attack using DNS spoofing.
And then when they visit ready it will redirect them to our server so I'll save that no closer.
And this could work if you're in a public hotspot.
It could work if you are connected to your neighbor's router or if you're in the same house and you're
all connected same router you can do this to another device on the same routes this could be a brothers
or sisters laptop only if you have permission.
So this video is for ethical and educational purposes only.
Make sure you got permission or make sure your own device that you're testing this on to useful this
video for pen testing so now that that's out the way like I was saying if this is your neighbor for
example and you're connected to the router so you've cracked the key and you've gotten to the router
you can use this DNS spoofing attack and then when they visit Web sites it will redirect them to your
Web site.
Same thing if you were in a public hotspots and say you created a fake access point and people are connected
to your fake access pinko free Wi-Fi similar to my hacking demonstration.
So if you haven't watched I recommend you go and do so.
But if people are connecting to your fake access points then you could still do the same thing.
You could use DNS spoofing to make Web sites change the IP addresses of same Web sites.
So now I've changed the index or Hey smile.
And our servers running.
So you need to do is type service Apache to start that reinstall Kelly Linux.
So now we've got that sorted.
The next thing we can do is if we open leaf pod.
So you just type leave part of ATC man in middle f man and middle after C and F for config.
So essentially it's just a config file then it should open a leaf pattern if you scroll down to the
records you see.
You should actually see the sprawl dot org.
So this just this default one just leave this.
But these are a records.
Now you might have a few more you might even of any here as long as you can type them correctly underneath
so if you press enter and then hit tab a few times to the cases just underneath the districts all of
the bracket then you can add different Web sites.
So we can use DNS here.
So if we want to use Reddit it now some Web sites may not work like Facebook I've had some trouble with.
So we'll use ready for this example server type Asterix.
Full stop Reddit dot com.
Then what we need to do is we need to redirect it to a scene IP address so we're not selling them or
in a sense would tell in the computers to send back a different IP address of a different Web site and
because Icesave is warning what we can do is just split this horizontally if type I have config you
can get the IP address of your local server by just getting the IP address of 88 0.
So I'm just going to copy this.
Now this might be Toby Lanzer Rovio depending on what college using and if your machine is virtual or
not.
For me it's easy nature and this is the IP address.
So I'm just gonna paste to here.
So now when they type in Reddit dot com it's gonna send them to this IP address instead of read it's
IP address the Asterix is a wild card so any soap directory of Reddit will also redirect to this IP
address.
So if we save this then the last thing we can do is run the man in the middle f attack.
So to do this you need to type M I see an F for men in the middle f then AARP then we need to spoof
then specify the type of card you using.
Now this might be a little bit confusing.
So if you're in public for example and or even in your own house and you've got your wireless USP card
as a fake access points it's acting as a fake router and people connect to it then what you will need
to use is you will need to use to be land zero here or the name if your Wi-Fi card because I'm using
a bridge connection to my host machines internal wireless card which is connected to the router then
I'm using 88 0.
So if your to make it to give you a better understanding if your neighbor has a laptop and you've got
your computer and you're both connected the same router you haven't got a fake access point you just
directly captives it to their router then you would use your wireless currency and send a wireless card
which could be called a teenager.
It might not be you just have to type I f config and find out.
Then you need to specify the gateway so if you open your terminal and type a R P hyphenate then you
can find out your gateway.
Now depending on if you're using this as a virtual machine as a dual boot on your laptop or computer
or using a wireless card.
So if I enabled my wireless card and connected to my router instead of doing it that way then my gateway
will change even on connected the same router.
The only reason my gateway is different is because this is a virtual machine connected to a bridge connection.
So if I was to disconnect and go up here and connect my Wi-Fi with with my USP adapter then my gateway
would change however you'd still be able to attack their computer because they still connect to the
same router except they're not connected to your fake access points so there's a few things you need
to look out for.
If one thing doesn't work just change it's the next there's not many all the different things you can
actually change.
So once you've got ITI zero or you took a non-zero depending on what you're using then if you type the
gateway so you just need to copy this here.
Like I said it could be different and this will be different for you because this is the IP address
of my router excuse me so I just type in IP hyphen and find out the gateway.
Then you need the target's IP address so you can find out through sniffing.
Or you could find history like wild shark etc. Then you need H S T S and then the last command is DNA
so all the commands are with two hyphens except the ie to specify what type of card we're using.
So once we click enter cervical cancer on this we get men in the middle f we give it a few seconds and
it should start to load.
There we go so now we are using a DNS attack.
I'll close out of this terminal and difficult to our target machine.
Now this is the IP address here of my target machine.
So just approved prove that I'm going to type Sam D then I'll get same deal.
And if a type IP hyphenate you can see the gateway is exactly the same.
So this is another method to make sure if you're testing your own devices then you could type a RPA
hyphen on the windows 10 machine and your copy machine.
Now your laptop could be within Windows 10 it doesn't really matter but you can see the both using the
same gateway.
So if you go back just to prove of closed both Buffalo page you can see the gateways exactly the same
then this is the IP address of the computer itself.
This is the computer that we're attacking their IP address.
So if we go back to our Kelly machine perfected what I'll do is I'll start the browser.
So we've already started the attack anyway so I'll open Internet Explorer.
So let's say this pass and this is a neighbor.
Now you have connected to a Wi-Fi spot and you've used DNS spoofing.
So you've got the gateway correct and you've got the IP address.
So you need to do now is wait for them to actually connect to your Web site.
So if they say for Reddit.
So you just type Reddit.
Dot com click enter and as you can see it says not really Reddit sorry but the U R L is exactly the
same as it would be.
Reddit so it's redirected them to our server.
So that's essentially DNS if it can be very useful if you don't want to use the inject attack with the
middle left because if you remember from the previous few videos we used modern middle F to inject all
beef.
OK so this is a similar way to get them hooked to your beef.
It could be a method to do that could be something completely different.
This is very useful for phishing as well.
So if you create a clone of Reddit or common then you spoof this when they try and visit rather talk
on they'll be sent to your fake one and you can get all their logging information.
So I think you could put two and two together and realize what you can do with your script if you remember
from before.
That will be in the next video.
So that was a for this one.
If it did help please if you like comments if you're stuck with anything I'll be happy to help.
And I will see you in the next video.