Network PentestPenetration TestingWireless Pentest

Create Automate Magic Script to Kick Clients AP Continuously

Welcome back Hackers! In This Tutorial we’re going to continue from our previous post about DoSing and kicking from Wi-Fi the loud guy or someone whom annoy much. From that, we have learned how to DoS a victim using deauthentication attack mode with aireplay-ng, But it was manual attack and take times.

Today we’re going to create our own automate bash script to deauth targets or victims continuously. I remind you that, before doing packet injection such DoSing, Spoofing, etc. make sure you have wireless adapter which is supporting packet injection. Some adapters are only support monitor mode only just be able to scanning, not injecting. Be aware of it, don’t expect high if use inappropriate device.

Before I Jump into Tutorial, Let me explain you the scenario here. Just like previous tutorial, we are a good guy, and will always be. But, our neighbor lets say his name is ‘John’ he hates us, John has access point name which is intended to mock you personally. You are feel challenged, and think he open a cyberWar on you. What would you do? Two things, hack the router, or DoS the AP. Because you got no time to serve him you want to only kick him to his own network, and fool him. Because you have already read an awesome tutorial post about “DoSing all clients in AP in“, then you fire up your Kali Linux machine.

STEP 1 : Open Terminal

You immediately open the terminal and doing information gathering, you need to know John access point MAC Address.

STEP 2 : Put Wireless Adapter into Monitor Mode

In order to scan wireless traffic you need to put your wireless adapter into monitor. Once you do that you can see all traffic passing through the air around you.

iw wlan1 interface add tai0 type monitor
ifconfig tai0 up

Rather than using airmon-ng you used “iw”, to create new monitor mode as “tai0” on wlan1 interface adapter. Note :

  • WLAN1 is your external USB wifi adapter
  • TAI0 is your new monitor mode, you can named it as you want.

STEP 3: Scan Wireless Traffic Using Airodump-ng

Now you your adapter in monitor mode, you need to use airodump-ng to view all traffics and parameter such ESSID, BSSID, CHANNEL etc. But you only need to grab the BSSID or target’s access point MAC Address.

Create Automate Magic Script to Kick Clients AP Continuously

You got the victim mac address and take it to note for further parameter into attack.

Access Point MAC Address (BSSID) : 60:18:88:B3:1B:60

STEP 4: Open Text Editor And Write The Script

You are going to use aireplay-ng to send deauth packet frames to victim access point, thus whoever tries to connect to that AP will be dropped by aireplay-ng. You then write a script on gedit text editor.

You want the script will send deauthentication packet frames to the victim Access point and all clients, kicking them off the network. After that we give them a rest time to re-authenticate for about 30 seconds, and then we deauthenticate them again, over and over. And we want this attack will only stop if we terminate by pressing CTRL+C key, and clean by itself. So this is your script.

Create Automate Magic Script to Kick Clients AP Continuously

  • #!/bin/bash Tells the terminal what interpreter you use
  • iface= Set your wireless adapter to use
  • AP= Victim access point MAC Address
  • iw $iface interface add tai0 type monitor Create monitor mode on wlan1, and assign it to tai0
  • ifconfig tai0 up Bring up the tai0 interface
  • function control_c() This function handle termination action, once you press the CTRL+C your script will not only just stop, but also delete the monitor mode.
  • for i in {1..1000} For loop that will execute ou commands thousand times
  • aireplay-ng –deauth 1000 Send deauth frames thousands times to victim
  • sleep 30s tell the script to sleep, does nothing for 30 seconds, in this way the victim and clients will be able to re-authenticate for 30 seconds

Done, you got to save the script to autoDoS.

STEP 5: Change Permission

To be able to execute your script, you then give execution permission. You type:

chmod +x autoDoS

STEP 6: Launch autoDos!

Finally all are ready, you execute the script by typing:


Now, the attack is running over and over, you are now away from keyboard and take some food, and watch movies. You will be able to terminate the script whenever you want, at any time. But, the victim may block our MAC Address, for further advanced customization for this script you could change your MAC Address before each deauthentication making it harder for the victim to stop you and you will be able to keep sending deauth frames.

Related Articles

Back to top button