- I've knocked this iPhone off the network.
This iPhone can connect to the network.
That PC is knocked off the network.
So PC is off the network,
iPhone is off the network, not able to connect,
but this one can still connect.
I have done a Denial-of-Service or DoS attack
against the wifi network.
Only this device is allowed to access the wifi network.
As simple as that, to run the script.
Now you can use this menu
to jump to specific topics in this video.
So if you're only interested in looking at the script,
have a look at this menu.
But before we continue,
I really wanna thank Linode for sponsoring this video.
I'm really happy to announce
that Linode are going to be sponsoring a bunch of videos,
very technical videos.
As an example, rather than buying a computer like this
that costs a lot of money,
that has a GPU in to crack WPA passwords,
you can use an online GPU from Linode.
So that's one of the videos that I wanna demonstrate.
Let me know what you think.
Would you like to see how to crack WPA passwords
using a crazy GPU like this or a cloud-based GPU?
I really wanna thank them for sponsoring this video
and sponsoring multiple videos
where I'm gonna show you a bunch of stuff
using their cloud-based solution.
(upbeat music)
In this video I'm gonna share and demonstrate
a Python script that runs a Denial-of-Service attack
against a wifi network.
It basically sends DoS messages or deauthentication messages
to a wifi access point to knock clients off the network.
But in addition,
you can specify that certain clients such as an iPhone
have access to the network
but all other devices are knocked off.
So basically you can decide
that certain devices that you control
have access to the network,
but all other devices are deauthenticated
or kicked off the wifi network.
Now, before we get started,
please do not use this script for malicious purposes.
Don't use this script in Starbucks
and take control of a Starbucks' wifi network.
That will only get you into trouble.
Don't use this on your parent's network
so that you can knock off other people in your family
from the wifi network and take control of the wifi network.
Do not use it on any network that you don't have permission
to run it against.
In this example,
I've got my own wifi network.
I'm testing the script against my own wifi router behind me.
I'm using my own wifi devices,
such as my own iPhone and my own laptop.
I am not using this on networks
that I don't have permission to attack.
Only use scripts like this
when you have permission to attack a network,
for instance, to demonstrate the vulnerabilities
of wifi networks or on networks that you own.
Okay, let's get started.
Now, previously I demonstrated a Denial-of-Service attack
similar to this in this video,
which I've linked here and below,
but that was a basic Python script.
It was a sequential script from top to bottom.
I basically showed you the power of Python
using a basic Python script.
But this script is a lot more powerful.
You'll need to understand more of Python
if you wanna understand all the details of the script.
But all you need to do to run the script
is run Python in Kali or Kali Linux as an example.
So to demonstrate this I've got Kali, or Kali if you prefer,
running within a virtual machine on my Mac.
You will need a wifi adapter such as this Alpha adapter
or an Alpha adapter like this
that supports packet injection and monitoring mode.
This is one of my favorite wifi adapters
because it works out of the box with Kali,
but the limitation of this wifi adapter
is that it only supports 2.4 gigahertz.
This wifi adapter supports 2.4 as well as five gigahertz.
So a lot more powerful, but is more expensive.
You also have to install drivers
to make that wifi adapter work.
The same with this one, another very popular Alpha adapter,
but you do need drivers to make this work.
I've put links below to other videos
where I show you how to get those working with Kali.
I've also listed other videos that you may find useful
when making a decision on which wifi adapter to purchase.
You can, in some cases, use a built-in wifi adapter,
but in many cases you need an external wifi adapter.
So in this example,
I'm gonna plug in this wifi adapter to my Mac.
So I'm simply connecting this to my Mac using a USB port.
And on my Mac, I'm gonna say connect to Linux
because I want the wifi adapter
connected to my Kali Linux installation.
I'll open up a Command Prompt, make this a bit bigger.
If I type iwconfig,
you'll see that I've got a wifi adapter connected to Kali.
That's required to make this work.
I'll clear the screen.
And what I'll do is open up Nano, which is a text editor,
and I'll create a Python script called wifidosown.
I'm gonna run a Denial-of-Service attack
against the wifi network and own it
so that specific devices have access to the wifi network
and others don't.
I'll knock off this Windows laptop as an example,
I'll knock off an iPhone,
but allow this iPhone to continue using the wifi network.
Okay, so open up Nano,
and then what I'm gonna do is copy this script.
I've put a link to the script below this video.
Once again, you can find it on my GitHub page,
but what I'm gonna simply do is copy that into the script.
On Kali, Control + X,
Y to save the file, press enter to save it.
So now when I type ls,
I have this file
and I can use sudo python3 wifidosown to run that script.
Okay, so first thing you need, once again,
is a wifi adapter that's picked up in Kali,
that's done here.
You need a wifi network that gonna attack.
I've got my own wifi network here.
You need some clients that you're going to attack.
With scripts like this
and the software that's used in the background,
you often need a client to connect to the wifi network.
So if nothing happens,
then get a client to connect to the wifi network.
So what I'm gonna do is on this Windows laptop next to me,
I'm gonna open up a Command Prompt
and I'm gonna set it to ping google.com continuously.
You can see that that ping is succeeding.
You can see that the wifi network
that the PC is connected to is TP Link F3FC,
which is, once again, this wifi network behind me.
Only attack wifi networks
that you have permission to attack.
Always remember that,
do not use the script maliciously.
On my two iPhones, I'll go to settings.
And what you'll notice is both of these phones are connected
to the TP Link network as well.
So I've got three clients connected to the same network.
I'll run the script, put in my sudo password.
Now it asks me for the MAC address that I want to exclude.
In other words, which MAC address or MAC addresses
is gonna be allowed access to the network.
So on my iPhone, I'll have a look at the MAC address.
I'm using private MAC addresses here,
so in other words, Apple changes the MAC address
every time I connect to a wifi network.
But in this case, it's BA
AD
08
AC
15
A7.
I just made that font slightly smaller.
So that's the MAC address of the iPhone,
that's the one that's gonna be excluded,
In other words, allowed to access the network.
Then you make a decision.
Are you going to connect to 2.4 gigahertz networks
or five gigahertz networks or both?
I'll select both,
even though on this network card
it only supports 2.4 gigahertz.
You can use both, it just means it takes longer
if there are lots of wifi networks.
Wifi network that I'm going to run the attack through
is wlan0.
That's the wifi adapter in Kali.
I can see that once again,
by opening up a terminal and typing iwconfig, wlan0.
So I'm gonna select zero once again and press enter.
Now what it's gonna do is it's gonna sniff the air
and look for wifi networks.
So it's gonna look for specific networks to attack.
And in this example,
nine is the network that I'm going to attack,
which is my TP Link.
So I'm gonna press Control + C,
I'm gonna say nine and press enter.
And just before I press enter,
notice the iPhone here is still connected
to the wifi network.
When I press enter,
it should knock me off the wifi network.
Now, in this case, I'm not any Mac addresses,
and that's because no new client
is connected to the network.
So what I'll do is I'll just get this to reconnect.
So I'll get it to reconnect to the network
and now MAC addresses are being discovered.
The windows laptop can't connect to the network anymore.
And the iPhone gets knocked off.
It actually automatically connects to a different network.
Notice there it says, unable to connect to the network,
but on this iPhone, I'm still connected to the network.
And I can still go to the internet,
as an example, go to kali.org.
I can press menu, look at the blog as an example.
I can surf using this iPhone,
but this iPhone is not able to connect
to that wifi network at all.
I've knocked this iPhone off the network.
This iPhone can connect to the network.
That PC is knocked off the network.
So PC is off the network,
iPhone is off the network, not able to connect,
but this one can still connect.
I have done a Denial-of-Service or DoS attack
against the wifi network.
Only this device is allowed to access the wifi network.
As simple as that, to run the script.
Now, the script is fairly complicated.
It's taken a long time to put this script together,
but again, it supports 2.4 gigahertz,
it supports five gigahertz,
it supports a range of wifi network cards.
I have essentially killed the wifi network.
Okay, I'll press Control + C to stop the deauth attack.
And then hopefully now,
the iPhone will be able to connect back to that network,
which it can.
And I'll be able to go to kali.org as an example,
which I can.
So that's allowed onto the network
and the PC can connect to the network as well.
I'm not gonna spend a lot of time
going through the Python script.
It's a fairly complicated Python script.
I put a lot of comments in the script
to make it easier to understand what we're doing
with the Python script.
It's available, once again,
using the link below on my GitHub page.
Okay, so that works.
Now let's try five gigahertz.
So for this demonstration
I'll use this Alpha network adapter.
You could also use this one if you prefer,
but for this example, I'll use this one.
I'll disconnect my other Alpha adapter
so this one is no longer connected.
And what I'll do is connect this adapter to Kali,
so it's now connected.
VMware asks me, do I wanna connect it to Mac or Linux?
So I'm gonna connect it to Linux.
So in my Command Prompt, iwconfig.
I should hopefully see a wifi adapter, which I do.
That's, once again, this adapter.
And what I'll do here is run the script.
So sudo python3 wifidosown.
Now in this example, I'm using the same network
but five gigahertz.
So my PC is connected to that network.
I'll connect my iPhones to that network as well.
So in settings on the first iPhone,
I'll connected to that network.
On the settings of the second iPhone,
I'll also connect it to the same network.
Okay, so this is the phone that's gonna be allowed
to access the network.
Notice the MAC address is now changed.
So in Kali I'll run my script.
MAC address that I want to exclude,
in this case is 8C
86
1E
58
67
9A.
Make that slightly smaller.
Again, that's this MAC address.
Everyone else will be killed from the network.
In this example, I'll select one for five gigahertz
so I'm only gonna check the a network.
Wlan0 is the wifi adapter that I wanna use.
It took it a while, but here's the network
that I wanna attack.
So I'm gonna press Control + C,
use 17 because that's the network that I wanna attack.
Before I do that,
notice the Windows PC is connected to that network
and pings are succeeding.
This iPhone, as an example, can go to Kali
so I can refresh the page, that works.
But what I'll do now is press enter,
that should kill the network.
Now, again, I found with this network card specifically,
you may need to get the client to reconnect
or get a new client to connect to the network
before the MAC addresses are picked up.
So I'm gonna get the iPhone to connect back to that network.
And now suddenly you see the MAC addresses are discovered
and hopefully what should happen
is the network fails.
You can see it's failing on the iPhone,
so the iPhone can't connect to that network.
If I try and connect it back to the network,
it's not allowing it to connect,
it simply bounces off and goes to another network.
iPhone cannot connect to that network at all.
So PC is off the network,
iPhone is struggling to connect to that network.
Let's see if this iPhone can connect to the network.
Still able to connect to Kali as an example.
So this device can access the network
whereas for instance,
the other devices can't.
I can, once again, try and download Kali.
I can connect to the network,
go to the blog, et cetera, et cetera,
because this device is connected to the TP Link 5G network.
It's been allowed into the network,
but other devices have been knocked off.
Once again, notice here,
I'm not able to connect to the network.
You can basically take over a wifi network
and only allow certain devices onto the network,
such as this iPhone
and knock everyone else off the network.
Be great to demonstrate how to crack passwords
using Nvidia GPU.
I have got an AMD GPU here,
but rather than buying a physical computer like this,
you can use the cloud to crack passwords
such as WPA passwords or other passwords.
As always, only use this for ethical purposes.
You can use the link below to get a hundred-dollar credit
when you sign up for Linode.
Let me know what you want me to demonstrate
using their cloud solution.
Definitely I'm gonna do GPU password cracking,
but perhaps you wanna learn some Linux commands,
perhaps you wanna learn artificial intelligence,
perhaps you just wanna learn how to host stuff in the cloud,
such as GNS3 lab topologies.
Let me know what you wanna see in the comments below.
(upbeat music)