From c948676fff3d58979d02fb7570bd0f1f3517dafc Mon Sep 17 00:00:00 2001 From: Stefan Kremser Date: Sat, 18 Feb 2017 13:51:08 +0100 Subject: [PATCH] little improvements - start beacon spam without a selected AP (not necessary). - added beaconChannel definition to Attack.h --- esp8266_deauther/Attack.cpp | 3 +-- esp8266_deauther/Attack.h | 3 ++- esp8266_deauther/esp8266_deauther.ino | 10 ++++++---- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/esp8266_deauther/Attack.cpp b/esp8266_deauther/Attack.cpp index 2647fa5..be789ee 100644 --- a/esp8266_deauther/Attack.cpp +++ b/esp8266_deauther/Attack.cpp @@ -96,7 +96,7 @@ void Attack::start(int num){ String Attack::getResults(){ - if(apScan.selected < 0) stati[0] = stati[1] = stati[2] = stati[3] = "no AP"; + if(apScan.selected < 0) stati[0] = stati[1] = stati[2] = "no AP"; String json = "{ \"aps\": ["; json += "\""+apScan.getAPName(apScan.selected)+"\""; @@ -261,7 +261,6 @@ void Attack::generatePacket(){/* if(running[2]){ //target spam - String apName = apScan.getAPName(apScan.selected); //adds spaces to the AP-SSID if the name length is smaller then the max size of 32 diff --git a/esp8266_deauther/Attack.h b/esp8266_deauther/Attack.h index c163fa7..7cf8b00 100644 --- a/esp8266_deauther/Attack.h +++ b/esp8266_deauther/Attack.h @@ -20,6 +20,7 @@ extern "C" { #define randomBeacons 50 #define SSIDLen 32 #define randomBeaconChange 3 +#define beaconChannel 10 extern void PrintHex8(uint8_t *data, uint8_t length); extern void getRandomVendorMac(uint8_t *buf); @@ -95,7 +96,7 @@ class Attack uint8_t beaconPacket_end[13] = { 0x01, 0x08, 0x82, 0x84, 0x8b, 0x96, 0x24, 0x30, 0x48, 0x6c, 0x03, 0x01, - 0x03 //channel + beaconChannel //channel }; uint8_t beaconWPA2tag[26] = { diff --git a/esp8266_deauther/esp8266_deauther.ino b/esp8266_deauther/esp8266_deauther.ino index 090af4a..3eaf32e 100644 --- a/esp8266_deauther/esp8266_deauther.ino +++ b/esp8266_deauther/esp8266_deauther.ino @@ -155,9 +155,11 @@ void setClientName(){ void sendAttackInfo(){ server.send ( 200, "text/json", attack.getResults()); } void startAttack(){ - if(server.hasArg("num") && apScan.selected > -1) { - - attack.start(server.arg("num").toInt()); - server.send ( 200, "text/json", "true"); + if(server.hasArg("num")) { + int _attackNum = server.arg("num").toInt(); + if(apScan.selected > -1 || _attackNum == 3){ + attack.start(server.arg("num").toInt()); + server.send ( 200, "text/json", "true"); + } } }