mirror of
https://github.com/SpacehuhnTech/esp8266_deauther.git
synced 2025-12-21 23:01:00 -08:00
Beautified stuff
This commit is contained in:
@@ -11,14 +11,15 @@
|
|||||||
// =========================== //
|
// =========================== //
|
||||||
|
|
||||||
// ===================== LED CONFIG ==================== //
|
// ===================== LED CONFIG ==================== //
|
||||||
|
|
||||||
/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
|
/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
|
||||||
Uncomment the type of LED you're using
|
Uncomment the type of LED you're using
|
||||||
Only one of them can be defined at a time!
|
Only one of them can be defined at a time!
|
||||||
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */
|
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */
|
||||||
#define DIGITAL_LED
|
#define DIGITAL_LED
|
||||||
// #define RGB_LED
|
//#define RGB_LED
|
||||||
// #define NEOPIXEL_LED
|
//#define NEOPIXEL_LED
|
||||||
|
|
||||||
|
#define HIGHLIGHT_LED 16
|
||||||
|
|
||||||
/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
|
/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
|
||||||
Adjust following settings for your type of LED
|
Adjust following settings for your type of LED
|
||||||
@@ -37,10 +38,11 @@
|
|||||||
// === Settings for Neopixel LED === //
|
// === Settings for Neopixel LED === //
|
||||||
#define LED_NEOPIXEL_NUM 1
|
#define LED_NEOPIXEL_NUM 1
|
||||||
#define LED_NEOPIXEL_PIN 15
|
#define LED_NEOPIXEL_PIN 15
|
||||||
#define LED_NEOPIXEL_MODE NEO_GRB + NEO_KHZ800
|
#define LED_NEOPIXEL_MODE NEO_GRBW + NEO_KHZ800
|
||||||
// NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs)
|
// NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs)
|
||||||
// NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)
|
// NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)
|
||||||
// NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products)
|
// NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products)
|
||||||
|
// NEO_GRBW Pixels are wired for GRBW bitstream
|
||||||
// NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)
|
// NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)
|
||||||
// NEO_RGBW Pixels are wired for RGBW bitstream (NeoPixel RGBW products)
|
// NEO_RGBW Pixels are wired for RGBW bitstream (NeoPixel RGBW products)
|
||||||
|
|
||||||
@@ -51,31 +53,33 @@
|
|||||||
Adjust the pins to match your setup
|
Adjust the pins to match your setup
|
||||||
Comment out the buttons you don't use.
|
Comment out the buttons you don't use.
|
||||||
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */
|
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */
|
||||||
#define BUTTON_UP 14
|
#define BUTTON_UP 12
|
||||||
#define BUTTON_DOWN 12
|
#define BUTTON_DOWN 13
|
||||||
#define BUTTON_A 13
|
#define BUTTON_A 14
|
||||||
|
|
||||||
// #define BUTTON_LEFT 12
|
//#define BUTTON_LEFT 12
|
||||||
// #define BUTTON_RIGHT 13
|
//#define BUTTON_RIGHT 13
|
||||||
// #define BUTTON_B 10
|
//#define BUTTON_B 10
|
||||||
|
|
||||||
/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
|
/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
|
||||||
Uncomment the type of display you're using
|
Uncomment the type of display you're using
|
||||||
Only one of them can be defined at a time!
|
Only one of them can be defined at a time!
|
||||||
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
|
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
|
||||||
*/
|
0x3c = I2C address
|
||||||
#define DEAUTHER_DISPLAY SSD1306Wire display = SSD1306Wire(0x3c, 5, 4); // for 0.96" OLED
|
SDA = GPIO 5 (D1)
|
||||||
// #define DEAUTHER_DISPLAY SH1106Wire display = SH1106Wire(0x3c, 5, 4); // for 1.3" OLED
|
SCL/SCK = GPIO 4 (D2) */
|
||||||
|
//#define DEAUTHER_DISPLAY SSD1306Wire display = SSD1306Wire(0x3c, 5, 4); // for 0.96" OLED
|
||||||
|
#define DEAUTHER_DISPLAY SH1106Wire display = SH1106Wire(0x3c, 5, 4); // for 1.3" OLED
|
||||||
|
|
||||||
/* RST = GPIO 5 (D1)
|
/* RST = GPIO 5 (D1)
|
||||||
DC = GPIO 4 (D2)
|
DC = GPIO 4 (D2)
|
||||||
CS = GPIO 15 (D8) or GND
|
CS = GPIO 15 (D8) or GND
|
||||||
SCK/SCL = GPIO 14 (D5)
|
SCK/SCL = GPIO 14 (D5)
|
||||||
SDA/MOSI = GPIO 13 (D7) */
|
SDA/MOSI = GPIO 13 (D7) */
|
||||||
// #define DEAUTHER_DISPLAY SSD1306Spi display = SSD1306Spi display = SSD1306Spi(5, 4, 15); // for 0.96" OLED with SPI
|
//#define DEAUTHER_DISPLAY SSD1306Spi display = SSD1306Spi display = SSD1306Spi(5, 4, 15); // for 0.96" OLED with SPI
|
||||||
// #define DEAUTHER_DISPLAY SH1106Spi display = SH1106Spi(5, 4, 15); // for 1.3" OLED with SPI
|
//#define DEAUTHER_DISPLAY SH1106Spi display = SH1106Spi(5, 4, 15); // for 1.3" OLED with SPI
|
||||||
|
|
||||||
// #define FLIP_DIPLAY // uncomment that to flip the display vertically
|
//#define FLIP_DIPLAY // uncomment that to flip the display vertically
|
||||||
// ========================================================= //
|
// ========================================================= //
|
||||||
|
|
||||||
#endif // ifndef config_h
|
#endif
|
||||||
|
|||||||
@@ -5,9 +5,11 @@ Accesspoints::Accesspoints() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Accesspoints::sort() {
|
void Accesspoints::sort() {
|
||||||
list->setCompare([](AP & a, AP & b) -> int {
|
list->setCompare([](AP& a, AP& b) -> int {
|
||||||
if (WiFi.RSSI(a.id) > WiFi.RSSI(b.id)) return -1;
|
if (WiFi.RSSI(a.id) > WiFi.RSSI(b.id)) return -1;
|
||||||
|
|
||||||
if (WiFi.RSSI(a.id) == WiFi.RSSI(b.id)) return 0;
|
if (WiFi.RSSI(a.id) == WiFi.RSSI(b.id)) return 0;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
});
|
});
|
||||||
list->sort();
|
list->sort();
|
||||||
@@ -15,9 +17,11 @@ void Accesspoints::sort() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Accesspoints::sortAfterChannel() {
|
void Accesspoints::sortAfterChannel() {
|
||||||
list->setCompare([](AP & a, AP & b) -> int {
|
list->setCompare([](AP& a, AP& b) -> int {
|
||||||
if (WiFi.channel(a.id) < WiFi.channel(b.id)) return -1;
|
if (WiFi.channel(a.id) < WiFi.channel(b.id)) return -1;
|
||||||
|
|
||||||
if (WiFi.channel(a.id) == WiFi.channel(b.id)) return 0;
|
if (WiFi.channel(a.id) == WiFi.channel(b.id)) return 0;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
});
|
});
|
||||||
list->sort();
|
list->sort();
|
||||||
@@ -227,20 +231,20 @@ void Accesspoints::remove(int num) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Accesspoints::select(String ssid) {
|
void Accesspoints::select(String ssid) {
|
||||||
for(int i=0;i<list->size();i++){
|
for (int i = 0; i < list->size(); i++) {
|
||||||
if(getSSID(i).equalsIgnoreCase(ssid)) select(i);
|
if (getSSID(i).equalsIgnoreCase(ssid)) select(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Accesspoints::deselect(String ssid) {
|
void Accesspoints::deselect(String ssid) {
|
||||||
for(int i=0;i<list->size();i++){
|
for (int i = 0; i < list->size(); i++) {
|
||||||
if(getSSID(i).equalsIgnoreCase(ssid)) deselect(i);
|
if (getSSID(i).equalsIgnoreCase(ssid)) deselect(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Accesspoints::remove(String ssid) {
|
void Accesspoints::remove(String ssid) {
|
||||||
for(int i=0;i<list->size();i++){
|
for (int i = 0; i < list->size(); i++) {
|
||||||
if(getSSID(i).equalsIgnoreCase(ssid)) remove(i);
|
if (getSSID(i).equalsIgnoreCase(ssid)) remove(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
/*
|
/*
|
||||||
Shitty code used less resources so I will keep this clusterfuck as it is,
|
Shitty code used less resources so I will keep this clusterfuck as it is,
|
||||||
but if you're interested I made a library for this: github.com/spacehuhn/SimpleCLI
|
but if you're interested I made a library for this: github.com/spacehuhn/SimpleCLI
|
||||||
*/
|
*/
|
||||||
|
|
||||||
CLI::CLI() {
|
CLI::CLI() {
|
||||||
list = new SimpleList<String>;
|
list = new SimpleList<String>;
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ void LED::setup() {
|
|||||||
#elif defined(NEOPIXEL_LED)
|
#elif defined(NEOPIXEL_LED)
|
||||||
led = new LED::NeopixelLED(LED_NEOPIXEL_NUM, LED_NEOPIXEL_PIN, LED_MODE_BRIGHTNESS);
|
led = new LED::NeopixelLED(LED_NEOPIXEL_NUM, LED_NEOPIXEL_PIN, LED_MODE_BRIGHTNESS);
|
||||||
led->setup();
|
led->setup();
|
||||||
#endif
|
#endif // if defined(DIGITAL_LED)
|
||||||
}
|
}
|
||||||
|
|
||||||
void LED::update() {
|
void LED::update() {
|
||||||
@@ -40,15 +40,19 @@ void LED::setMode(uint8_t mode, bool force) {
|
|||||||
case LED_MODE::OFF:
|
case LED_MODE::OFF:
|
||||||
led->setColor(0, 0, 0);
|
led->setColor(0, 0, 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LED_MODE::SCAN:
|
case LED_MODE::SCAN:
|
||||||
led->setColor(0, 0, 255);
|
led->setColor(0, 0, 255);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LED_MODE::ATTACK:
|
case LED_MODE::ATTACK:
|
||||||
led->setColor(255, 255, 0);
|
led->setColor(255, 255, 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LED_MODE::DEAUTH:
|
case LED_MODE::DEAUTH:
|
||||||
led->setColor(255, 0, 0);
|
led->setColor(255, 0, 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LED_MODE::IDLE:
|
case LED_MODE::IDLE:
|
||||||
led->setColor(0, 255, 0);
|
led->setColor(0, 255, 0);
|
||||||
break;
|
break;
|
||||||
@@ -129,6 +133,7 @@ LED::AnalogRGBLED::AnalogRGBLED(uint8_t rPin, uint8_t gPin, uint8_t bPin, uint8_
|
|||||||
LED::AnalogRGBLED::rPin = rPin;
|
LED::AnalogRGBLED::rPin = rPin;
|
||||||
LED::AnalogRGBLED::gPin = gPin;
|
LED::AnalogRGBLED::gPin = gPin;
|
||||||
LED::AnalogRGBLED::bPin = bPin;
|
LED::AnalogRGBLED::bPin = bPin;
|
||||||
|
|
||||||
setBrightness(brightness);
|
setBrightness(brightness);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -117,8 +117,8 @@ bool Names::check(int num) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int Names::findID(uint8_t* mac) {
|
int Names::findID(uint8_t* mac) {
|
||||||
for(int i=0;i<list->size();i++){
|
for (int i = 0; i < list->size(); i++) {
|
||||||
if(memcmp(mac, list->get(i).mac, 6) == 0) return i;
|
if (memcmp(mac, list->get(i).mac, 6) == 0) return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
@@ -194,7 +194,7 @@ void SSIDs::add(String name, bool wpa2, int clones, bool force) {
|
|||||||
if (clones > SSID_LIST_SIZE) clones = SSID_LIST_SIZE;
|
if (clones > SSID_LIST_SIZE) clones = SSID_LIST_SIZE;
|
||||||
|
|
||||||
for (int i = 0; i < clones; i++) {
|
for (int i = 0; i < clones; i++) {
|
||||||
if(clones > 1) name = randomize(name);
|
if (clones > 1) name = randomize(name);
|
||||||
|
|
||||||
internal_add(name, wpa2, name.length());
|
internal_add(name, wpa2, name.length());
|
||||||
|
|
||||||
|
|||||||
@@ -408,18 +408,23 @@ uint32_t Scan::getPackets(int i) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String Scan::getMode(){
|
String Scan::getMode() {
|
||||||
switch(scanMode) {
|
switch (scanMode) {
|
||||||
case SCAN_MODE_OFF:
|
case SCAN_MODE_OFF:
|
||||||
return String(SC_MODE_OFF);
|
return String(SC_MODE_OFF);
|
||||||
|
|
||||||
case SCAN_MODE_APS:
|
case SCAN_MODE_APS:
|
||||||
return String(SC_MODE_AP);
|
return String(SC_MODE_AP);
|
||||||
|
|
||||||
case SCAN_MODE_STATIONS:
|
case SCAN_MODE_STATIONS:
|
||||||
return String(SC_MODE_ST);
|
return String(SC_MODE_ST);
|
||||||
|
|
||||||
case SCAN_MODE_ALL:
|
case SCAN_MODE_ALL:
|
||||||
return String(SC_MODE_ALL);
|
return String(SC_MODE_ALL);
|
||||||
|
|
||||||
case SCAN_MODE_SNIFFER:
|
case SCAN_MODE_SNIFFER:
|
||||||
return String(SC_MODE_SNIFFER);
|
return String(SC_MODE_SNIFFER);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return String();
|
return String();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,8 +39,7 @@ class Scan {
|
|||||||
Scan();
|
Scan();
|
||||||
|
|
||||||
void sniffer(uint8_t* buf, uint16_t len);
|
void sniffer(uint8_t* buf, uint16_t len);
|
||||||
void start(uint8_t mode, uint32_t time, uint8_t nextmode, uint32_t continueTime, bool channelHop,
|
void start(uint8_t mode, uint32_t time, uint8_t nextmode, uint32_t continueTime, bool channelHop, uint8_t channel);
|
||||||
uint8_t channel);
|
|
||||||
void start(uint8_t mode);
|
void start(uint8_t mode);
|
||||||
|
|
||||||
void setup();
|
void setup();
|
||||||
|
|||||||
@@ -19,57 +19,37 @@ void Settings::load() {
|
|||||||
|
|
||||||
// AP
|
// AP
|
||||||
if (data.containsKey(keyword(S_SSID))) setSSID(data.get<String>(keyword(S_SSID)));
|
if (data.containsKey(keyword(S_SSID))) setSSID(data.get<String>(keyword(S_SSID)));
|
||||||
|
|
||||||
if (data.containsKey(keyword(S_PASSWORD))) setPassword(data.get<String>(keyword(S_PASSWORD)));
|
if (data.containsKey(keyword(S_PASSWORD))) setPassword(data.get<String>(keyword(S_PASSWORD)));
|
||||||
|
|
||||||
if (data.containsKey(keyword(S_CHANNEL))) setChannel(data.get<uint8_t>(keyword(S_CHANNEL)));
|
if (data.containsKey(keyword(S_CHANNEL))) setChannel(data.get<uint8_t>(keyword(S_CHANNEL)));
|
||||||
|
|
||||||
if (data.containsKey(keyword(S_HIDDEN))) setHidden(data.get<bool>(keyword(S_HIDDEN)));
|
if (data.containsKey(keyword(S_HIDDEN))) setHidden(data.get<bool>(keyword(S_HIDDEN)));
|
||||||
|
|
||||||
if (data.containsKey(keyword(S_CAPTIVEPORTAL))) setCaptivePortal(data.get<bool>(keyword(S_CAPTIVEPORTAL)));
|
if (data.containsKey(keyword(S_CAPTIVEPORTAL))) setCaptivePortal(data.get<bool>(keyword(S_CAPTIVEPORTAL)));
|
||||||
|
|
||||||
// GENERAL
|
// GENERAL
|
||||||
if (data.containsKey(keyword(S_LANG))) setLang(data.get<String>(keyword(S_LANG)));
|
if (data.containsKey(keyword(S_LANG))) setLang(data.get<String>(keyword(S_LANG)));
|
||||||
|
|
||||||
if (data.containsKey(keyword(S_DISPLAYINTERFACE))) setDisplayInterface(data.get<bool>(keyword(S_DISPLAYINTERFACE)));
|
if (data.containsKey(keyword(S_DISPLAYINTERFACE))) setDisplayInterface(data.get<bool>(keyword(S_DISPLAYINTERFACE)));
|
||||||
|
|
||||||
if (data.containsKey(keyword(S_DISPLAY_TIMEOUT))) setDisplayTimeout(data.get<uint32_t>(keyword(S_DISPLAY_TIMEOUT)));
|
if (data.containsKey(keyword(S_DISPLAY_TIMEOUT))) setDisplayTimeout(data.get<uint32_t>(keyword(S_DISPLAY_TIMEOUT)));
|
||||||
|
|
||||||
if (data.containsKey(keyword(S_SERIALINTERFACE))) setCLI(data.get<bool>(keyword(S_SERIALINTERFACE)));
|
if (data.containsKey(keyword(S_SERIALINTERFACE))) setCLI(data.get<bool>(keyword(S_SERIALINTERFACE)));
|
||||||
|
|
||||||
if (data.containsKey(keyword(S_SERIAL_ECHO))) setSerialEcho(data.get<bool>(keyword(S_SERIAL_ECHO)));
|
if (data.containsKey(keyword(S_SERIAL_ECHO))) setSerialEcho(data.get<bool>(keyword(S_SERIAL_ECHO)));
|
||||||
|
|
||||||
if (data.containsKey(keyword(S_WEBINTERFACE))) setWebInterface(data.get<bool>(keyword(S_WEBINTERFACE)));
|
if (data.containsKey(keyword(S_WEBINTERFACE))) setWebInterface(data.get<bool>(keyword(S_WEBINTERFACE)));
|
||||||
|
|
||||||
if (data.containsKey(keyword(S_WEB_SPIFFS))) setWebSpiffs(data.get<bool>(keyword(S_WEB_SPIFFS)));
|
if (data.containsKey(keyword(S_WEB_SPIFFS))) setWebSpiffs(data.get<bool>(keyword(S_WEB_SPIFFS)));
|
||||||
|
|
||||||
if (data.containsKey(keyword(S_LEDENABLED))) setLedEnabled(data.get<bool>(keyword(S_LEDENABLED)));
|
if (data.containsKey(keyword(S_LEDENABLED))) setLedEnabled(data.get<bool>(keyword(S_LEDENABLED)));
|
||||||
|
|
||||||
if (data.containsKey(keyword(S_MACAP))) setMacAP(data.get<String>(keyword(S_MACAP)));
|
if (data.containsKey(keyword(S_MACAP))) setMacAP(data.get<String>(keyword(S_MACAP)));
|
||||||
|
|
||||||
if (data.containsKey(keyword(S_MACST))) setMacSt(data.get<String>(keyword(S_MACST)));
|
if (data.containsKey(keyword(S_MACST))) setMacSt(data.get<String>(keyword(S_MACST)));
|
||||||
|
|
||||||
// SCAN
|
// SCAN
|
||||||
if (data.containsKey(keyword(S_CHTIME))) setChTime(data.get<uint16_t>(keyword(S_CHTIME)));
|
if (data.containsKey(keyword(S_CHTIME))) setChTime(data.get<uint16_t>(keyword(S_CHTIME)));
|
||||||
|
|
||||||
if (data.containsKey(keyword(S_MIN_DEAUTHS))) setMinDeauths(data.get<uint16_t>(keyword(S_MIN_DEAUTHS)));
|
if (data.containsKey(keyword(S_MIN_DEAUTHS))) setMinDeauths(data.get<uint16_t>(keyword(S_MIN_DEAUTHS)));
|
||||||
|
|
||||||
// ATTACK
|
// ATTACK
|
||||||
if (data.containsKey(keyword(S_ATTACKTIMEOUT))) setAttackTimeout(data.get<uint32_t>(keyword(S_ATTACKTIMEOUT)));
|
if (data.containsKey(keyword(S_ATTACKTIMEOUT))) setAttackTimeout(data.get<uint32_t>(keyword(S_ATTACKTIMEOUT)));
|
||||||
|
|
||||||
if (data.containsKey(keyword(S_FORCEPACKETS))) setForcePackets(data.get<uint8_t>(keyword(S_FORCEPACKETS)));
|
if (data.containsKey(keyword(S_FORCEPACKETS))) setForcePackets(data.get<uint8_t>(keyword(S_FORCEPACKETS)));
|
||||||
|
|
||||||
if (data.containsKey(keyword(S_DEAUTHSPERTARGET))) setDeauthsPerTarget(data.get<uint16_t>(keyword(
|
if (data.containsKey(keyword(S_DEAUTHSPERTARGET))) setDeauthsPerTarget(data.get<uint16_t>(keyword(
|
||||||
S_DEAUTHSPERTARGET)));
|
S_DEAUTHSPERTARGET)));
|
||||||
|
|
||||||
if (data.containsKey(keyword(S_DEAUTHREASON))) setDeauthReason(data.get<uint8_t>(keyword(S_DEAUTHREASON)));
|
if (data.containsKey(keyword(S_DEAUTHREASON))) setDeauthReason(data.get<uint8_t>(keyword(S_DEAUTHREASON)));
|
||||||
|
|
||||||
if (data.containsKey(keyword(S_BEACONCHANNEL))) setBeaconChannel(data.get<bool>(keyword(S_BEACONCHANNEL)));
|
if (data.containsKey(keyword(S_BEACONCHANNEL))) setBeaconChannel(data.get<bool>(keyword(S_BEACONCHANNEL)));
|
||||||
|
|
||||||
if (data.containsKey(keyword(S_BEACONINTERVAL))) setBeaconInterval(data.get<bool>(keyword(S_BEACONINTERVAL)));
|
if (data.containsKey(keyword(S_BEACONINTERVAL))) setBeaconInterval(data.get<bool>(keyword(S_BEACONINTERVAL)));
|
||||||
|
|
||||||
if (data.containsKey(keyword(S_RANDOMTX))) setRandomTX(data.get<bool>(keyword(S_RANDOMTX)));
|
if (data.containsKey(keyword(S_RANDOMTX))) setRandomTX(data.get<bool>(keyword(S_RANDOMTX)));
|
||||||
|
|
||||||
if (data.containsKey(keyword(S_PROBESPERSSID))) setProbesPerSSID(data.get<uint8_t>(keyword(S_PROBESPERSSID)));
|
if (data.containsKey(keyword(S_PROBESPERSSID))) setProbesPerSSID(data.get<uint8_t>(keyword(S_PROBESPERSSID)));
|
||||||
|
|
||||||
if (version != VERSION) {
|
if (version != VERSION) {
|
||||||
@@ -345,8 +325,6 @@ uint32_t Settings::getAutosaveTime() {
|
|||||||
return autosaveTime;
|
return autosaveTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool Settings::getBeaconInterval() {
|
bool Settings::getBeaconInterval() {
|
||||||
return beaconInterval;
|
return beaconInterval;
|
||||||
}
|
}
|
||||||
@@ -435,16 +413,19 @@ bool Settings::getWebSpiffs() {
|
|||||||
|
|
||||||
void Settings::setDeauthsPerTarget(uint16_t deauthsPerTarget) {
|
void Settings::setDeauthsPerTarget(uint16_t deauthsPerTarget) {
|
||||||
Settings::deauthsPerTarget = deauthsPerTarget;
|
Settings::deauthsPerTarget = deauthsPerTarget;
|
||||||
|
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Settings::setDeauthReason(uint8_t deauthReason) {
|
void Settings::setDeauthReason(uint8_t deauthReason) {
|
||||||
Settings::deauthReason = deauthReason;
|
Settings::deauthReason = deauthReason;
|
||||||
|
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Settings::setBeaconChannel(bool beaconChannel) {
|
void Settings::setBeaconChannel(bool beaconChannel) {
|
||||||
Settings::beaconChannel = beaconChannel;
|
Settings::beaconChannel = beaconChannel;
|
||||||
|
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -457,16 +438,19 @@ void Settings::setForcePackets(uint8_t forcePackets) {
|
|||||||
|
|
||||||
void Settings::setAutosave(bool autosave) {
|
void Settings::setAutosave(bool autosave) {
|
||||||
Settings::autosave = autosave;
|
Settings::autosave = autosave;
|
||||||
|
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Settings::setAutosaveTime(uint32_t autosaveTime) {
|
void Settings::setAutosaveTime(uint32_t autosaveTime) {
|
||||||
Settings::autosaveTime = autosaveTime;
|
Settings::autosaveTime = autosaveTime;
|
||||||
|
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Settings::setBeaconInterval(bool beaconInterval) {
|
void Settings::setBeaconInterval(bool beaconInterval) {
|
||||||
Settings::beaconInterval = beaconInterval;
|
Settings::beaconInterval = beaconInterval;
|
||||||
|
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -504,21 +488,25 @@ void Settings::setPassword(String password) {
|
|||||||
|
|
||||||
void Settings::setCLI(bool cli) {
|
void Settings::setCLI(bool cli) {
|
||||||
Settings::cli = cli;
|
Settings::cli = cli;
|
||||||
|
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Settings::setDisplayInterface(bool displayInterface) {
|
void Settings::setDisplayInterface(bool displayInterface) {
|
||||||
Settings::displayInterface = displayInterface;
|
Settings::displayInterface = displayInterface;
|
||||||
|
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Settings::setWebInterface(bool webInterface) {
|
void Settings::setWebInterface(bool webInterface) {
|
||||||
Settings::webInterface = webInterface;
|
Settings::webInterface = webInterface;
|
||||||
|
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Settings::setChTime(uint16_t chTime) {
|
void Settings::setChTime(uint16_t chTime) {
|
||||||
Settings::chTime = chTime;
|
Settings::chTime = chTime;
|
||||||
|
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -560,16 +548,19 @@ bool Settings::setMacAP(uint8_t* macAP) {
|
|||||||
|
|
||||||
void Settings::setRandomTX(bool randomTX) {
|
void Settings::setRandomTX(bool randomTX) {
|
||||||
Settings::randomTX = randomTX;
|
Settings::randomTX = randomTX;
|
||||||
|
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Settings::setAttackTimeout(uint32_t attackTimeout) {
|
void Settings::setAttackTimeout(uint32_t attackTimeout) {
|
||||||
Settings::attackTimeout = attackTimeout;
|
Settings::attackTimeout = attackTimeout;
|
||||||
|
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Settings::setLedEnabled(bool ledEnabled) {
|
void Settings::setLedEnabled(bool ledEnabled) {
|
||||||
Settings::ledEnabled = ledEnabled;
|
Settings::ledEnabled = ledEnabled;
|
||||||
|
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -582,35 +573,42 @@ void Settings::setProbesPerSSID(uint8_t probesPerSSID) {
|
|||||||
|
|
||||||
void Settings::setHidden(bool hidden) {
|
void Settings::setHidden(bool hidden) {
|
||||||
Settings::hidden = hidden;
|
Settings::hidden = hidden;
|
||||||
|
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Settings::setCaptivePortal(bool captivePortal) {
|
void Settings::setCaptivePortal(bool captivePortal) {
|
||||||
Settings::captivePortal = captivePortal;
|
Settings::captivePortal = captivePortal;
|
||||||
|
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Settings::setMinDeauths(uint16_t minDeauths) {
|
void Settings::setMinDeauths(uint16_t minDeauths) {
|
||||||
Settings::minDeauths = minDeauths;
|
Settings::minDeauths = minDeauths;
|
||||||
|
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Settings::setDisplayTimeout(uint32_t displayTimeout) {
|
void Settings::setDisplayTimeout(uint32_t displayTimeout) {
|
||||||
Settings::displayTimeout = displayTimeout;
|
Settings::displayTimeout = displayTimeout;
|
||||||
|
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Settings::setLang(String lang) {
|
void Settings::setLang(String lang) {
|
||||||
Settings::lang = lang;
|
Settings::lang = lang;
|
||||||
|
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Settings::setSerialEcho(bool serialEcho) {
|
void Settings::setSerialEcho(bool serialEcho) {
|
||||||
Settings::serialEcho = serialEcho;
|
Settings::serialEcho = serialEcho;
|
||||||
|
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Settings::setWebSpiffs(bool webSpiffs) {
|
void Settings::setWebSpiffs(bool webSpiffs) {
|
||||||
Settings::webSpiffs = webSpiffs;
|
Settings::webSpiffs = webSpiffs;
|
||||||
|
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
@@ -28,8 +28,10 @@ int Stations::findStation(uint8_t* mac) {
|
|||||||
|
|
||||||
void Stations::sort() {
|
void Stations::sort() {
|
||||||
list->setCompare([](Station& a, Station& b) -> int {
|
list->setCompare([](Station& a, Station& b) -> int {
|
||||||
if(*(a.pkts) > *(b.pkts)) return -1;
|
if (*(a.pkts) > *(b.pkts)) return -1;
|
||||||
if(*(a.pkts) == *(b.pkts)) return 0;
|
|
||||||
|
if (*(a.pkts) == *(b.pkts)) return 0;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
});
|
});
|
||||||
list->sort();
|
list->sort();
|
||||||
@@ -37,8 +39,10 @@ void Stations::sort() {
|
|||||||
|
|
||||||
void Stations::sortAfterChannel() {
|
void Stations::sortAfterChannel() {
|
||||||
list->setCompare([](Station& a, Station& b) -> int {
|
list->setCompare([](Station& a, Station& b) -> int {
|
||||||
if(a.ch < b.ch) return -1;
|
if (a.ch < b.ch) return -1;
|
||||||
if(a.ch == b.ch) return 0;
|
|
||||||
|
if (a.ch == b.ch) return 0;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
});
|
});
|
||||||
list->sort();
|
list->sort();
|
||||||
@@ -257,20 +261,20 @@ void Stations::remove(int num) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Stations::select(String ssid) {
|
void Stations::select(String ssid) {
|
||||||
for(int i=0;i<list->size();i++){
|
for (int i = 0; i < list->size(); i++) {
|
||||||
if(getAPStr(i).equalsIgnoreCase(ssid)) select(i);
|
if (getAPStr(i).equalsIgnoreCase(ssid)) select(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Stations::deselect(String ssid) {
|
void Stations::deselect(String ssid) {
|
||||||
for(int i=0;i<list->size();i++){
|
for (int i = 0; i < list->size(); i++) {
|
||||||
if(getAPStr(i).equalsIgnoreCase(ssid)) deselect(i);
|
if (getAPStr(i).equalsIgnoreCase(ssid)) deselect(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Stations::remove(String ssid) {
|
void Stations::remove(String ssid) {
|
||||||
for(int i=0;i<list->size();i++){
|
for (int i = 0; i < list->size(); i++) {
|
||||||
if(getAPStr(i).equalsIgnoreCase(ssid)) remove(i);
|
if (getAPStr(i).equalsIgnoreCase(ssid)) remove(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -110,8 +110,8 @@ void setup() {
|
|||||||
|
|
||||||
// load Wifi settings: SSID, password,...
|
// load Wifi settings: SSID, password,...
|
||||||
#ifdef DEFAULT_SSID
|
#ifdef DEFAULT_SSID
|
||||||
if(settings.getSSID() == "pwned") settings.setSSID(DEFAULT_SSID);
|
if (settings.getSSID() == "pwned") settings.setSSID(DEFAULT_SSID);
|
||||||
#endif
|
#endif // ifdef DEFAULT_SSID
|
||||||
loadWifiConfigDefaults();
|
loadWifiConfigDefaults();
|
||||||
|
|
||||||
// dis/enable serial command interface
|
// dis/enable serial command interface
|
||||||
@@ -162,6 +162,6 @@ void loop() {
|
|||||||
booted = true;
|
booted = true;
|
||||||
#ifdef HIGHLIGHT_LED
|
#ifdef HIGHLIGHT_LED
|
||||||
displayUI.setupLED();
|
displayUI.setupLED();
|
||||||
#endif
|
#endif // ifdef HIGHLIGHT_LED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -202,6 +202,7 @@ bool eqls(const char* str, const char* keywordPtr) {
|
|||||||
uint8_t lenKeyword = strlen(keyword);
|
uint8_t lenKeyword = strlen(keyword);
|
||||||
|
|
||||||
if (lenStr > lenKeyword) return false; // string can't be longer than keyword (but can be smaller because of '/'
|
if (lenStr > lenKeyword) return false; // string can't be longer than keyword (but can be smaller because of '/'
|
||||||
|
|
||||||
// and ',')
|
// and ',')
|
||||||
|
|
||||||
uint8_t a = 0;
|
uint8_t a = 0;
|
||||||
@@ -449,11 +450,10 @@ void strToColor(String str, uint8_t* buf) {
|
|||||||
for (uint8_t i = 0; i < 3; i++) buf[i] = strtoul((str.substring(i * 2, i * 2 + 2)).c_str(), NULL, 16);
|
for (uint8_t i = 0; i < 3; i++) buf[i] = strtoul((str.substring(i * 2, i * 2 + 2)).c_str(), NULL, 16);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
String center(String a, int len) {
|
String center(String a, int len) {
|
||||||
int spaces = len - a.length();
|
int spaces = len - a.length();
|
||||||
|
|
||||||
for (int i = 0; i < spaces; i+=2) {
|
for (int i = 0; i < spaces; i += 2) {
|
||||||
a = ' ' + a + ' ';
|
a = ' ' + a + ' ';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ extern "C" {
|
|||||||
/*
|
/*
|
||||||
This file contains all necessary functions for hosting and connecting to an access point.
|
This file contains all necessary functions for hosting and connecting to an access point.
|
||||||
For compatibility and simplicity, all those functions are global.
|
For compatibility and simplicity, all those functions are global.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Important strings
|
// Important strings
|
||||||
const char W_DEAUTHER[] PROGMEM = "deauth.me"; // captive portal domain (alternative to 192.168.4.1)
|
const char W_DEAUTHER[] PROGMEM = "deauth.me"; // captive portal domain (alternative to 192.168.4.1)
|
||||||
|
|||||||
Reference in New Issue
Block a user