@@ -15,15 +15,14 @@ extern "C" {
15
15
#include " Attack.h"
16
16
17
17
const static char *ssid = " pwned" ;
18
- const static char *password = " deauther" ;
18
+ const static char *password = " deauther" ; // must have at least 8 characters
19
19
20
20
ESP8266WebServer server (80 );
21
21
22
22
/*
23
23
I had some troubles implementing singleton classes.
24
24
see: https://github.com/esp8266/Arduino/issues/500
25
- They fixed this issue with in the newer SDK version (the one we can't use),
26
- so I used global variables.
25
+ They fixed this issue within a newer SDK version - the one we can't use, so I used global variables.
27
26
*/
28
27
29
28
NameList nameList;
@@ -39,9 +38,13 @@ void sniffer(uint8_t *buf, uint16_t len){
39
38
void startWifi (){
40
39
WiFi.mode (WIFI_STA);
41
40
wifi_set_promiscuous_rx_cb (sniffer);
42
- WiFi.softAP (ssid, password);
43
- Serial.println (" SSID: " +(String)ssid);
44
- Serial.println (" Password: " +(String)password);
41
+ WiFi.softAP (ssid, password); // for an open network without a password change to: WiFi.softAP(ssid);
42
+ String _ssid = (String)ssid;
43
+ String _password = (String)password;
44
+ Serial.println (" SSID: " +_ssid);
45
+ Serial.println (" Password: " +_password);
46
+ if (_password.length ()<8 ) Serial.println (" WARNING: password must have at least 8 characters!" );
47
+ if (_ssid.length ()<1 || _ssid.length ()>32 ) Serial.println (" WARNING: SSID length must be between 1 and 32 characters!" );
45
48
}
46
49
47
50
@@ -131,7 +134,7 @@ void startClientScan(){
131
134
server.send (200 , " text/json" , " true" );
132
135
clientScan.start (server.arg (" time" ).toInt ());
133
136
attack.stop (0 );
134
- } else server.send ( 200 , " text/json" , " false " );
137
+ } else server.send ( 200 , " text/json" , " Error: no selected access point " );
135
138
}
136
139
137
140
void sendClientResults (){ server.send ( 200 , " text/json" , clientScan.getResults ()); }
0 commit comments