diff --git a/esp8266_deauther/APScan.cpp b/esp8266_deauther/APScan.cpp index 0faba4e..35f0a09 100644 --- a/esp8266_deauther/APScan.cpp +++ b/esp8266_deauther/APScan.cpp @@ -70,7 +70,7 @@ String APScan::getResults(){ json += "\"vendor\": \""+getAPVendor(i)+"\","; json += "\"selected\": "+getAPSelected(i); json += "}"; - if(i!=results-1) json += ","; + if((i!=results-1) && (i!=maxResults-1)) json += ","; } json += "] }"; return json; diff --git a/esp8266_deauther/Attack.cpp b/esp8266_deauther/Attack.cpp index be789ee..c8955ac 100644 --- a/esp8266_deauther/Attack.cpp +++ b/esp8266_deauther/Attack.cpp @@ -131,7 +131,7 @@ String Attack::getResults(){ void Attack::run(){ currentMillis = millis(); - if(running[0]){ + if(running[0]){//deauth all if((currentMillis - previousMillis[0]) >= 1000/deauthsPerSecond){ int clientsSelected = 0; @@ -171,7 +171,7 @@ void Attack::run(){ } } - if(running[1]){ + if(running[1]){//deauth selected if((currentMillis - previousMillis[1]) >= 1000/deauthsPerSecond){ //send deauth @@ -207,7 +207,7 @@ void Attack::run(){ } - if(running[2] || running[3]){ + if(running[2] || running[3]){//beacon spam if((currentMillis - previousMillis[3]) >= 1000/beaconPerSecond){ previousMillis[3] = millis(); @@ -216,7 +216,7 @@ void Attack::run(){ for(int i=0;i= randomBeaconChange*1000){ generate(oldRandomBeacon); @@ -310,8 +303,6 @@ void Attack::generatePacket(){/* //set MAC for(int i=0;i<6;i++) packet[10+i] = packet[16+i] = beaconMACs[randomBeaconCounter][i]; - - //} } void Attack::stopAll(){ diff --git a/esp8266_deauther/Attack.h b/esp8266_deauther/Attack.h index 23db5ad..b2ef3e7 100644 --- a/esp8266_deauther/Attack.h +++ b/esp8266_deauther/Attack.h @@ -17,7 +17,7 @@ extern "C" { #define deauthsPerSecond 10 //number of deauthentication & disassociation frames sent per second per target. #define beaconPerSecond 10 //number of beacon frames sent per second -#define randomBeacons 50 //number of generated beacon frames +#define randomBeacons 80 //number of generated beacon frames #define SSIDLen 32 //SSID length of random generated APs (random beacon spam) #define randomBeaconChange 3 //time in seconds after new beacon frames are generated #define beaconChannel 10 //channel to send beacon frames on (only for the packet bytes, it will actually sent on the current channel) @@ -40,7 +40,7 @@ class Attack void stopAll(); void stop(int num); private: - void generatePacket(); + void generateBeaconPacket(); bool send(uint8_t buf[], int len); const String attackNames[attackNum] = {"deauth selected","deauth all","beacon spam","random beacon spam"}; @@ -80,7 +80,7 @@ class Attack uint8_t beaconPacket_header[36] = { 0x80, 0x00, 0x00, 0x00, //beacon - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //destination: broadcast + 0x80, 0x7a, 0xbf, 0x3f, 0x8c, 0xac, //destination: broadcast 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, //source 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, //source 0xc0, 0x6c, diff --git a/esp8266_deauther/ClientScan.cpp b/esp8266_deauther/ClientScan.cpp index 1706ccc..a1df84a 100644 --- a/esp8266_deauther/ClientScan.cpp +++ b/esp8266_deauther/ClientScan.cpp @@ -98,7 +98,7 @@ String ClientScan::getResults(){ json += "\"vendor\": \""+(String)getClientVendor(i)+"\","; json += "\"selected\": "+(String)getClientSelected(i); json += "}"; - if(i!=results-1) json += ","; + if((i!=results-1) && (i!=maxResults-1)) json += ","; } json += "] }"; return json; diff --git a/esp8266_deauther/NameList.cpp b/esp8266_deauther/NameList.cpp index 9e9ea68..3175ef4 100644 --- a/esp8266_deauther/NameList.cpp +++ b/esp8266_deauther/NameList.cpp @@ -45,6 +45,7 @@ void NameList::save(){ void NameList::add(Mac client, String name){ if(clients.add(client)) len++; + else Serial.println("WARNING: name list is full!"); uint8_t _buf[nameLength]; name.getBytes(_buf,nameLength); for(int i=0;i