Hello, everyone, welcome to another video of our five p.m. testing series, last time we modified
our code to detect associated clients and of course, you can add the request and clear to send and
detect them when they are sending and receiving data means they are already connected to the access
point.
We might add that later as well.
But today we need to know how to make our Python script to switch channels.
If you notice from before, we were only listening on one specific channel.
But what about the other channels?
Yeah, now we will modify our code a little bit to listen on all channels in order for us to do that.
First, we need a function to change our channel from Python like this switch from one channel to another.
Do you remember this command?
And also there is another command using the idea, but this command is switching from one channel to
another.
So let's try it our function.
Again, I'm going to pause the video, write the function and explain later just to save time.
First line in our function, this line is a command that we are using to change the channel I have that
we your mom said channel followed by the channel number, then a list of channels we want to switch
to.
Then in a while loop, we need to loop through the list and use our always the system function to use
the system command and change the channel.
The reason why I'm using a statement here to check for 111 or six is what I want to wait for one full
second between each one of these.
Like if it's one or 11 or six, wait for one second.
Why I'm doing this is because most access points, they like to use those three channels.
So I want to pause or wait for one second if it's one of these channels, if not just three hundred
milliseconds.
OK, now what?
We created our function.
Now we need to run this function in the background.
Well, how do we do that?
You remember from the back door series, we need to use a threading function.
Right.
So we need to import threading function first at the top.
I really have it here in import threading.
Right.
Now let's create our threading object, all right, to
that thread.
Give it the argument, which is the function, name
one, said Damon.
We want to read as Damon Drew and then t one start.
But first, just for the sake of, you know, like checking things were just plain common these days
from now, leave it just so we can control the channels that we want to listen to
so we know that we most of our channels, most of our access points are on Channel 11.
So let's just switch for maybe five.
OK, we have only one access point.
But that's it, right?
Just one, right?
So now let's go back to our script again and common these three lines, which they will start our function.
And the function will it will switch all channels, right, one by one.
Oh, let's see, we got some other channels here.
We're still getting some nice good the means is working.
We can listen now in old old channels, right?
That was good, wasn't it?
All right, that was it for this video.
Next time, we will go for the offensive mode.
Thanks for watching.
See you in the next video.