Skip to content

Commit c948676

Browse files
author
Stefan Kremser
committed
little improvements
- start beacon spam without a selected AP (not necessary). - added beaconChannel definition to Attack.h
1 parent 779b527 commit c948676

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

esp8266_deauther/Attack.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ void Attack::start(int num){
9696

9797
String Attack::getResults(){
9898

99-
if(apScan.selected < 0) stati[0] = stati[1] = stati[2] = stati[3] = "no AP";
99+
if(apScan.selected < 0) stati[0] = stati[1] = stati[2] = "no AP";
100100

101101
String json = "{ \"aps\": [";
102102
json += "\""+apScan.getAPName(apScan.selected)+"\"";
@@ -261,7 +261,6 @@ void Attack::generatePacket(){/*
261261

262262
if(running[2]){ //target spam
263263

264-
265264
String apName = apScan.getAPName(apScan.selected);
266265

267266
//adds spaces to the AP-SSID if the name length is smaller then the max size of 32

esp8266_deauther/Attack.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ extern "C" {
2020
#define randomBeacons 50
2121
#define SSIDLen 32
2222
#define randomBeaconChange 3
23+
#define beaconChannel 10
2324

2425
extern void PrintHex8(uint8_t *data, uint8_t length);
2526
extern void getRandomVendorMac(uint8_t *buf);
@@ -95,7 +96,7 @@ class Attack
9596
uint8_t beaconPacket_end[13] = {
9697
0x01, 0x08, 0x82, 0x84,
9798
0x8b, 0x96, 0x24, 0x30, 0x48, 0x6c, 0x03, 0x01,
98-
0x03 //channel
99+
beaconChannel //channel
99100
};
100101

101102
uint8_t beaconWPA2tag[26] = {

esp8266_deauther/esp8266_deauther.ino

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,11 @@ void setClientName(){
155155
void sendAttackInfo(){ server.send ( 200, "text/json", attack.getResults()); }
156156

157157
void startAttack(){
158-
if(server.hasArg("num") && apScan.selected > -1) {
159-
160-
attack.start(server.arg("num").toInt());
161-
server.send ( 200, "text/json", "true");
158+
if(server.hasArg("num")) {
159+
int _attackNum = server.arg("num").toInt();
160+
if(apScan.selected > -1 || _attackNum == 3){
161+
attack.start(server.arg("num").toInt());
162+
server.send ( 200, "text/json", "true");
163+
}
162164
}
163165
}

0 commit comments

Comments
 (0)