diff --git a/.gitignore b/.gitignore deleted file mode 100644 index f805e81..0000000 --- a/.gitignore +++ /dev/null @@ -1,33 +0,0 @@ -# Object files -*.o -*.ko -*.obj -*.elf - -# Precompiled Headers -*.gch -*.pch - -# Libraries -*.lib -*.a -*.la -*.lo - -# Shared objects (inc. Windows DLLs) -*.dll -*.so -*.so.* -*.dylib - -# Executables -*.exe -*.out -*.app -*.i*86 -*.x86_64 -*.hex - -# Debug files -*.dSYM/ -*.su diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 09e8899..0000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,5 +0,0 @@ -Please only make pull requests to the [testing branch](https://github.com/spacehuhn/esp8266_deauther/tree/testing) to avoid future conflicts. -The `testing` branch is merged with `master` on every release. - -**Issues** should contain a detailed description with as much information as possible! -Also note that issues are for resolving bugs and not to solve YOUR upload error. Please read the [FAQ](https://github.com/spacehuhn/esp8266_deauther/wiki/FAQ), [README](https://github.com/spacehuhn/esp8266_deauther/blob/master/README.md) and search for similar issues before posting a new one. diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md deleted file mode 100644 index 277869a..0000000 --- a/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,31 +0,0 @@ -Please fill the info fields, it helps to get you faster support ;) - -If you have a Guru Meditation Error, please decode it: -https://github.com/me-no-dev/EspExceptionDecoder - ------------------------------ Remove above ----------------------------- - - -### Hardware/Flashing: -Board: ?ESP8266 dev module?Tindie OLED?Wemos Mini?Other (specify)? -Using OLED: ?YES?NO? -Using WebServer: ?YES?NO? -Using Serial: ?YES?NO? -Installation mode: ?binary?source? -Code/binary version: ?1.5?1.6? -Flash size: ?1M/512K? -Flash method: ?esptool?Arduino IDE? -Flash Frequency: ?40Mhz? -Upload Speed: ?115200? -Powered by: ?USB?Battery? - -### Description: -Describe your problem here, provide as many details as possible. -Make sure you read the FAQ first, incomplete bug reports will be CLOSED without notice. - -What you're expecting: --- -What you get instead: --- - -### Debug Messages: -``` -Put the serial output here diff --git a/LICENSE b/LICENSE index cbcab81..388e191 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2017 Stefan Kremser +Copyright (c) 2018 Stefan Kremser Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -12,7 +12,7 @@ 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. -Do not redistribute, advertising or sell of this softwae as "jammer"! +Do not redistribute, advertise or sell this software as a "jammer"! THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, @@ -20,4 +20,4 @@ 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. \ No newline at end of file +SOFTWARE. diff --git a/README.md b/README.md index 46e0635..92b6ca5 100644 --- a/README.md +++ b/README.md @@ -1,298 +1,102 @@ -# ESP8266 Deauther -Deauthentication attack and other exploits using an ESP8266! +# ESP8266 Deauther 2.0 -esp8266 deauther with smartphone +

logo

🐩 Twitter | đŸ“ș YouTube | 🌍 spacehuhn.de

-Support me and my projects by purchasing one of the official deauther boards.
Or become my patron on patreon.com/spacehuhn.
+Support the development of this project by purchasing one of the official deauther boards.
Or become a patron on patreon.com/spacehuhn.

-## Contents -- [Introduction](#introduction) - - [What it is and how it works](#what-it-is-and-how-it-works) - - [How to protect yourself against it](#how-to-protect-yourself-against-it) -- [Disclaimer](#disclaimer) -- [Supported Devices](#supported-devices) -- [Installation](#installation) - - [Uploading the bin files](#uploading-the-bin-files) - - [Compiling the source with Arduino](#compiling-the-source-with-arduino) - - [Adding an OLED display](#adding-an-oled-display) -- [How to use it](#how-to-use-it) -- [FAQ](https://github.com/spacehuhn/esp8266_deauther/wiki/FAQ) -- [License](#license) -- [Sources and additional links](#sources-and-additional-links) - - [Custom Design Versions](#custom-design-versions) - - [Videos](#videos) - - [Sources](#sources) +## What is New +Version 2.0: +- Completly rewritten code base for better performance and later enhancements +- Custom Deauther SDK for easy compiling using Arduino +- New serial command line interface to control and debug the program +- New display UI with a lot of new functions +- Improved web interface with multi-language support +- Improved scanning for access points and stations (+ continuous scanning mode) +- Save and select device names for both scanning and attacking +- Save up to 60 SSIDs and 25 devices in one list (you can create, load and save multiple lists) +- Added [PacketMonitor](https://github.com/spacehuhn/PacketMonitor) to display UI +- Deauth detection when scanning +- RGB LED support for a quick indication what the device is doing (attacking, scanning, ...) +- Better documentation on the new [wiki](https://github.com/spacehuhn/deauther2.0/wiki) -## Introduction +## About this project +**Scan for access points, client devices, disconnect them, create dozens of fake WiFi networks and confuse other wireless scanners!** -### What it is and how it works +This software allows you to easily perform a variety of actions to test 802.11 wireless networks by using an inexpensive ESP8266 WiFi SoC (System On A Chip). -This software allows you to perform a [deauth attack](https://en.wikipedia.org/wiki/Wi-Fi_deauthentication_attack) with an ESP8266 against selected networks. -The [ESP8266](https://en.wikipedia.org/wiki/ESP8266) is a cheap and easy to use Wi-Fi SoC (System-on-a-Chip), programmable with the [Arduino IDE](https://www.arduino.cc/en/Main/Software). -With this software flashed onto it, you can select a target network and start different attacks. +The main feature, the deauthentication attack, is used to disconnect devices from their WiFi network. +No one seems to care about this huge vulnerability in the official 802.11 WiFi standard, so I took action and enabled everyone with less than 10 USD to recreate this project. +I hope it raises more attention on the issue. In 2009 the WiFi Alliance actually fixed the problem (see [802.11w](https://en.wikipedia.org/wiki/IEEE_802.11w-2009)), but only a few companies implemented it into their devices and software. +To effectively prevent a deauthentication attack, both client and access point must support the 802.11w standard with protected managment frames (PMF). +While most client devices seem to support it when the access point forces it, basically no WiFi access point has it enabled. -The deauth attack will, if the connection is vulnerable, disconnect the devices from the network. Because the attack is running constantly, the devices will be disconnected again and again. Depending on the network, that can either block a connection or slow it down. +Feel free to test your hardware, annoy these companies with the problem, share this project and push for a fix! +This project is also a great way to learn more about WiFi, micro controllers, Arduino, hacking and electronics/programming in general. +**But please use this tool responsably and do not use it against others without their permission!** -**The difference between deauthing and jamming:** [WiFi Jammers vs Deauthers | What's The Difference?](https://www.youtube.com/watch?v=6m2vY2HXU60) - -Other attacks also have been implemented, such as beacon and probe request flooding. - -The deauth attack works by exploiting an old and known vulnerability in the 802.11 Wi-Fi protocol. -Because these [deauthentication frames](https://mrncciew.com/2014/10/11/802-11-mgmt-deauth-disassociation-frames/), usually used to close a Wi-Fi connection safely, are unencrypted, it's very easy to spoof them. You only need the mac address of the access point, which you can sniff easily. -If you don't want to attack all connected devices, you can also scan for connections and attack them specifically. - -**Is deauthing legal?** [WiFi Jammers/Deauthers | Legal?](https://www.youtube.com/watch?v=IromynQ1srI) - -### How to protect yourself against it - -With [802.11w-2009](https://en.wikipedia.org/wiki/IEEE_802.11w-2009) the Wi-Fi protocol became encrypted management (and deauthentication) frames. This makes spoofing these packets way harder and the attack, in this form, ineffective. -So make sure your router is up to date and has management frame protection enabled. Your client device (e.g your phone, notebook etc.) needs to support that too. Both ends of the connection need to use it! - -The problem with that is, most routers use unencrypted managment frames by default, don't provide any option to change that and don't provide any information about this issue. -I tested several networks and couldn't find one that wasn't vulnerable! - -I made a [Deauth Detector](https://github.com/spacehuhn/DeauthDetector) using the same ESP8266 to indicate high amounts of deauth frames. It can't protect you, but it can help you figure out if and when an attack is going on. +The difference between deauthing and jamming: [click me](https://github.com/spacehuhn/deauther2.0/wiki/FAQ#difference-between-jammer-and-deauther) ## Disclaimer - -**This project is a proof of concept for testing and educational purposes.** -Neither the ESP8266, nor its SDK was meant or build for such purposes. -Bugs can occur! +This project is a proof of concept for testing and educational purposes. +Neither the ESP8266, nor its SDK was meant or build 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. I don't take any responsibility for what you do with this program. -Please check the legal regulations in your country before using it. -**It is not a frequency jammer as claimed falsely by many people.** Its attack, how it works and how to protect against it is described above. It uses valid Wi-Fi frames described in the official 802.11 standard and doesn't block or disrupt any frequencies. +It is not a frequency jammer as claimed falsely by many people. Its attack, its method and how to protect against it is described above. It uses valid Wi-Fi frames described in the IEEE 802.11 standard and doesn't block or disrupt any frequencies. -My intention with this project is to draw more attention on this issue. -This attack shows how vulnerable the 802.11 Wi-Fi standard is and that it has to be fixed. -**A solution is already there, why don't we use it?** +This project is meant to draw more attention on this issue. +The [deauthentication](https://en.wikipedia.org/wiki/Wi-Fi_deauthentication_attack) attack shows how vulnerable the 802.11 Wi-Fi standard is and that it has to be fixed. +A solution is already there, why don't we use it? -Please don't refer to this project as "jammer", that totally undermines the real purpose of this project! +**Please don't refer to this project as "jammer", that totally undermines the real purpose of this project!** +If you do, it only prooves that you didn't understand anything of what this project stands for. Publishing content about this without a proper explaination shows that you only do it for the clicks, fame and/or money and have no respect for intellectual property, the community behind it and the fight for a better WiFi standard! -## Supported Devices +## Getting Started -**You can flash this software yourself onto any ESP8266**, but if you would like to support me, you can get one of the DSTIKE development boards that are made for this project and come with everything preinstalled! -Here is the link to Travis Lin's shop who makes them: -- [AliExpress](https://dstike.aliexpress.com/store/2996024) +Visit our new [Wiki](https://github.com/spacehuhn/deauther2.0/wiki) on how to recreate this project and use it. +Happy Hacking! + +## Official Deauther Boards + +![PICTURE DSTIKE Deauther OLED Board](https://github.com/spacehuhn/deauther2.0/blob/master/img/DSTIKE_Deauther_Board.jpg) + +If you want to support the development of this project, you can buy one of the offical boards by DSTIKE (Travis Lin) on following sites: - [Tindie](https://tindie.com/stores/lspoplove) +- [AliExpress](https://dstike.aliexpress.com/store/2996024) - [Taobao](https://shop135375846.taobao.com) - -## Installation -You have 2 choices here. Uploading the .bin files is easier, but not as good for debugging. -**YOU ONLY NEED TO DO ONE OF THE INSTALLATION METHODS!** +Those boards are optimized for this project, ready to use and come preflashed with the Deauther software! +For more details visit the [Wiki](https://github.com/spacehuhn/deauther2.0/wiki) under [Supported Devices](https://github.com/spacehuhn/deauther2.0/wiki/Supported-Devices). -### Uploading the bin files +## Credits +A huge thanks to: +- [@deantonious](http://github.com/deantonious) +- [@jLynx](https://github.com/jLynx) +- [@lspoplove](https://github.com/lspoplove) +- [@schinfo](https://github.com/schinfo) +- [@tobozo](https://github.com/tobozo) +- [@xdavidhu](https://github.com/xdavidhu) +- [@PwnKitteh](https://github.com/PwnKitteh) -**0** Download the current release from [releases](https://github.com/spacehuhn/esp8266_deauther/releases) +for helping out with various things regarding this project and keeping it alive! -Always use the 1mb version, unless you're sure that your ESP8266 only has 512kb flash memory. -**Note:** the 512kb version won't have the full mac vendors list. +I also want to thank Espressif and their community for this awesome chip and all the software and hardware projects around it and the countless tutorials you can find online! -**1** Upload using the ESP8266 flash tool of your choice: - - [nodemcu-flasher](https://github.com/nodemcu/nodemcu-flasher) [Windows only] - - [esptool-gui](https://github.com/Rodmg/esptool-gui) [Windows, MacOS] - - [esptool](https://github.com/espressif/esptool) [Windows, MacOS, Linux] +Shoutout to everyone working on the libraries used for this project: +- [esp8266-oled-ssd1306](https://github.com/ThingPulse/esp8266-oled-ssd1306) +- [ArduinoJson](https://github.com/bblanchon/ArduinoJson) +- [LinkedList](https://github.com/ivanseidel/LinkedList) -**That's all!** - -Make sure your settings are correct for your board. Most boards come with 4mb flash and sometimes you have to hold the flash button down while plugging it in and hold it until the flashing process started. - -Also make sure you select the right com-port, the right upload size (mostly 4mb) and the correct .bin file. - -If it's not working, you can try using the Arduino as descriped below. - -### Compiling the source with Arduino - -**0** Download the source code of this project. - -**1** Install [Arduino](https://www.arduino.cc/en/Main/Software) and open it. - -**2** Go to `File` > `Preferences` - -**3** Add `http://arduino.esp8266.com/stable/package_esp8266com_index.json` to the Additional Boards Manager URLs. (source: https://github.com/esp8266/Arduino) - -**4** Go to `Tools` > `Board` > `Boards Manager` - -**5** Type in `esp8266` - -**6** Select version `2.0.0` and click on `Install` (**must be version 2.0.0!**) - -![screenshot of arduino, selecting the right version](https://raw.githubusercontent.com/spacehuhn/esp8266_deauther/master/screenshots/arduino_screenshot_1.JPG) - -**7** Go to `File` > `Preferences` - -**8** Open the folder path under `More preferences can be edited directly in the file` - -![screenshot of arduino, opening folder path](https://raw.githubusercontent.com/spacehuhn/esp8266_deauther/master/screenshots/arduino_screenshot_2.JPG) - -**9** Go to `packages` > `esp8266` > `hardware` > `esp8266` > `2.0.0` > `tools` > `sdk` > `include` - -**10** Open `user_interface.h` with a text editor - -**11** Scroll down and before `#endif` add following lines: - -``` -typedef void (*freedom_outside_cb_t)(uint8 status); -int wifi_register_send_pkt_freedom_cb(freedom_outside_cb_t cb); -void wifi_unregister_send_pkt_freedom_cb(void); -int wifi_send_pkt_freedom(uint8 *buf, int len, bool sys_seq); -``` - -![screenshot of notepad, copy paste the right code](https://raw.githubusercontent.com/spacehuhn/esp8266_deauther/master/screenshots/notepad_screenshot_1.JPG) - -**don't forget to save!** - -**12** Go to the SDK_fix folder of this project - -**13** Copy ESP8266Wi-Fi.cpp and ESP8266Wi-Fi.h - -**14** Paste these files here `packages` > `esp8266` > `hardware` > `esp8266` > `2.0.0` > `libraries` > `ESP8266WiFi` > `src` - -**15** Open `esp8266_deauther` > `esp8266_deauther.ino` in Arduino - -**16** Select your ESP8266 board at `Tools` > `Board` and the right port at `Tools` > `Port` -If no port shows up you may have to reinstall the drivers. - -**17** Depending on your board you may have to adjust the `Tools` > `Board` > `Flash Frequency` and the `Tools` > `Board` > `Flash Size`. I use a `160MHz` flash frequency and a `4M (3M SPIFFS)` flash size. - -**18** Upload! - -**19** Install the [ESP8266 Sketh Data uploader](https://github.com/esp8266/arduino-esp8266fs-plugin) plugin, your mileage may vary depending on your version of Arduino IDE. - -**20** Restart Arduino IDE, reopen the project, and from the "tools" menu, choose "ESP8266 Sketch Data Upload". - - -**Note:** If you use a 512kb version of the ESP8266, you will need to comment out a part of the mac vendor list in data.h. Otherwise it will use too much memory to fit on 512kb. - -**Your ESP8266 Deauther is now ready!** - - -### Updating the MAC vendor list -The utils folder includes a python script for downloading the latest ["manuf"](https://code.wireshark.org/review/gitweb?p=wireshark.git;a=blob_plain;f=manuf) file from Whireshark and convert it to the format understood by esp8266_deauther. - -The usage of the script is quite simple: `update_manuf.py [-h] [-o OUTPUT] [-u URL]` , e.g: -``` -cd utils -python update_manuf.py -o ../esp8266_deauther/oui.h -``` - -### Adding an OLED display - -![image of the esp8266 deauther with an OLED and three buttons](https://raw.githubusercontent.com/spacehuhn/esp8266_deauther/master/screenshots/esp8266_with_oled.jpg) - -I included 2 extra .bin files for the display version on the release page. -One for the 0.96" SSD1306 OLED and one for the 1.3" SH1106 OLED. - -| Display | ESP8266 | -| ------- | ------- | -| SDA | 5 (D1) | -| SCL | 4 (D2) | -| GND | GND | -| VCC | VCC (3.3V) | - -The buttons have to be between following pins and GND: - -| Button | ESP8266 | -| ------ | ------- | -| up | 12 (D6) | -| down | 13 (D7) | -| select | 14 (D5) | - - -If you use Arduino, you have will need to install this library: https://github.com/squix78/esp8266-oled-ssd1306. -Then you only need to uncomment `//#define USE_DISPLAY` in the beginning of the sketch. -Below that, you can customize the settings: - -``` - //create display(Adr, SDA-pin, SCL-pin) - SSD1306 display(0x3c, 5, 4); //GPIO 5 = D1, GPIO 4 = D2 - //SH1106 display(0x3c, 5, 4); - - //button pins - #define upBtn 12 //GPIO 12 = D6 - #define downBtn 13 //GPIO 13 = D7 - #define selectBtn 14 //GPIO 14 = D5 - #define displayBtn 0 //GPIO 0 = FLASH BUTTON -``` - -## How to use it - -First start your ESP8266 by plugging it in and giving it power. - -Scan for Wi-Fi networks and connect to `pwned`. The password is `deauther`. -Once connected, you can open up your browser and go to `192.168.4.1`. - -You can now scan for networks... -![webinterface AP scanner](https://raw.githubusercontent.com/spacehuhn/esp8266_deauther/master/screenshots/web_screenshot_1.JPG) - -scan for client devices... -![webinterface client scanner](https://raw.githubusercontent.com/spacehuhn/esp8266_deauther/master/screenshots/web_screenshot_2.JPG) - -Note: While scanning the ESP8266 will shut down its access point, so you may have to go to your settings and reconnect to the Wi-Fi network manually! - -...and start different attacks. -![webinterface attack menu](https://raw.githubusercontent.com/spacehuhn/esp8266_deauther/master/screenshots/web_screenshot_3.JPG) - -For more information please read the [FAQ](https://github.com/spacehuhn/esp8266_deauther/wiki/FAQ). +Also thanks to everyone that supports this project by [donating](http://spacehuhn.de/donate), beeing my [patron](http://patreon.com/spacehuhn) or bying one of the [official Deauther boards](https://www.tindie.com/stores/lspoplove) from DSTIKE. ## License This software is licensed under the MIT License. See the [license file](LICENSE) for details. - -## Sources and additional links - -### Custom Design Versions - -![Screenshot of 'Wi-PWN'](https://raw.githubusercontent.com/samdenty99/Wi-PWN/master/pictures/secondary-banner.png) -[Wi-PWN](https://github.com/samdenty99/Wi-PWN) - By [@samdenty99](https://github.com/samdenty99) - -![Screenshot of 'Modern and Consistent'](https://raw.githubusercontent.com/Wandmalfarbe/esp8266_deauther/master/screenshots/web_screenshot_1.png) -[Modern and Consistent](https://github.com/Wandmalfarbe/esp8266_deauther) - By [@Wandmalfarbe](https://github.com/Wandmalfarbe) - -Screenshot of DeAutherDroid App - -[DeAutherDroid Android APP](https://github.com/ExploiTR/DeAutherDroid) - By [@ExploiTR](https://github.com/ExploiTR) - -### Videos - -[![Explaining WFi Deauthing and Jammers (And the problem with 802.11)](https://img.youtube.com/vi/GUZyCV5c1SY/0.jpg)](https://www.youtube.com/watch?v=GUZyCV5c1SY) - -[![Cheap Wi-Fi 'Jammer' Device | NodeMCU](https://img.youtube.com/vi/oQQhBdCQOTM/0.jpg)](https://www.youtube.com/watch?v=oQQhBdCQOTM) - -[![Wifi 'Jammer' Device V1.1 | Setup Tutorial](https://img.youtube.com/vi/r5aoV5AolNo/0.jpg)](https://www.youtube.com/watch?v=r5aoV5AolNo) - -[![WiFi Tutorial "Deauthing Made Simple"](https://img.youtube.com/vi/SswI-J-M2SE/0.jpg)](https://www.youtube.com/watch?v=SswI-J-M2SE) - -[![Seguridad Inalåmbrica | Explicación de Wifi Deauther en Español](https://img.youtube.com/vi/YYsSDXRgD10/0.jpg)](https://www.youtube.com/watch?v=YYsSDXRgD10) - -[![WiFi Jammers/Deauthers | Legal?](https://img.youtube.com/vi/IromynQ1srI/0.jpg)](https://www.youtube.com/watch?v=IromynQ1srI) - -[![WiFi Jammers vs Deauthers | What's The Difference?](https://img.youtube.com/vi/6m2vY2HXU60/0.jpg)](https://www.youtube.com/watch?v=6m2vY2HXU60) - -### Sources - -deauth attack: https://en.wikipedia.org/wiki/Wi-Fi_deauthentication_attack - -deauth frame: https://mrncciew.com/2014/10/11/802-11-mgmt-deauth-disassociation-frames/ - -ESP8266: -* https://en.wikipedia.org/wiki/ESP8266 -* https://espressif.com/en/products/hardware/esp8266ex/overview - -packet injection with ESP8266: -* http://hackaday.com/2016/01/14/inject-packets-with-an-esp8266/ -* http://bbs.espressif.com/viewtopic.php?f=7&t=1357 -* https://github.com/pulkin/esp8266-injection-example - -802.11w-2009: https://en.wikipedia.org/wiki/IEEE_802.11w-2009 - -Wi-Fi_send_pkt_freedom function limitations: https://esp32.com/viewtopic.php?t=586 diff --git a/Reset_Sketch/Reset_Sketch.ino b/Reset_Sketch/Reset_Sketch.ino new file mode 100644 index 0000000..15482fe --- /dev/null +++ b/Reset_Sketch/Reset_Sketch.ino @@ -0,0 +1,45 @@ +#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"); + + SPIFFS.begin(); + Serial.println("SPIFFS initialized"); + + SPIFFS.format(); + Serial.println("SPIFFS cleaned"); + + ESP.eraseConfig(); + + Serial.println("WiFi credentials erased"); + + Serial.println("DONE!"); + + ESP.reset(); +} + +void loop() { + +} diff --git a/configs/deauther_board_oled.txt b/configs/deauther_board_oled.txt new file mode 100644 index 0000000..b9d983b --- /dev/null +++ b/configs/deauther_board_oled.txt @@ -0,0 +1,81 @@ +#ifndef config_h +#define config_h + +// ===== DISPLAY LIBRARY ===== // +#include +#include +#include "SH1106Wire.h" +#include "SSD1306Wire.h" +#include "SH1106Spi.h" +#include "SSD1306Spi.h" +// =========================== // + +// ===================== LED CONFIG ==================== // +/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = + Uncomment the type of LED you're using + Only one of them can be defined at a time! + = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */ +#define DIGITAL_LED +//#define RGB_LED +//#define NEOPIXEL_LED + +/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = + Adjust following settings for your type of LED + you can ignore the rest of the #define's + = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */ +// === Settings for Digital LED === // +#define LED_ENABLE_R true +#define LED_ENABLE_G false +#define LED_ENABLE_B true + +// === Settings for Digital LED and RGB LED === // +#define LED_CATHODE false // common ground (GND) +#define LED_PIN_R 2 // ESP-12 LED +#define LED_PIN_G 0 +#define LED_PIN_B 16 // NodeMCU on-board LED + +// === Settings for RGB LED and Neopixel LED === // +#define LED_MODE_BRIGHTNESS 10 // brightness of LED modes +#define LED_DYNAMIC_BRIGHTNESS false // brightness in scan mode depending on packet rate and deauths per second + +// === Settings for Neopixel LED === // +#define LED_NEOPIXEL_NUM 1 +#define LED_NEOPIXEL_PIN 9 +// if it doesn't work try changing NEO_GRB to NEO_GRBW +#define LED_NEOPIXEL Adafruit_NeoPixel(LED_NEOPIXEL_NUM, LED_NEOPIXEL_PIN, NEO_GRB + NEO_KHZ800) + +// ===================== DISPLAY CONFIG ==================== // +#define USE_DISPLAY true // will force display on + +/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = + Adjust the pins to match your setup + Comment out the buttons you don't use. + = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */ +#define BUTTON_UP 12 +#define BUTTON_DOWN 13 +#define BUTTON_A 14 + +//#define BUTTON_LEFT 12 +//#define BUTTON_RIGHT 13 +//#define BUTTON_B 10 + +/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = + Uncomment the type of display you're using + Only one of them can be defined at a time! + = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = + 0x3c = I2C address + SDA = GPIO 5 (D1) + SCL/SCK = GPIO 4 (D2) */ +//#define DEAUTHER_DISPLAY SSD1306Wire display = SSD1306Wire(0x3c, 5, 4); // for 0.96" OLED +#define DEAUTHER_DISPLAY SH1106Wire display = SH1106Wire(0x3c, 5, 4); // for 1.3" OLED + +/* RST = GPIO 5 (D1) + DC = GPIO 4 (D2) + CS = GPIO 15 (D8) or GND + SCK/SCL = GPIO 14 (D5) + SDA/MOSI = GPIO 13 (D7) */ +//#define DISPLAY SSD1306Spi display = SSD1306Spi display = SSD1306Spi(5, 4, 15); // for 0.96" OLED with SPI +//#define DISPLAY SH1106Spi display = SH1106Spi(5, 4); // for 1.3" OLED with SPI +// ========================================================= // + +#endif \ No newline at end of file diff --git a/configs/deauther_board_oled_RGB.txt b/configs/deauther_board_oled_RGB.txt new file mode 100644 index 0000000..081068e --- /dev/null +++ b/configs/deauther_board_oled_RGB.txt @@ -0,0 +1,81 @@ +#ifndef config_h +#define config_h + +// ===== DISPLAY LIBRARY ===== // +#include +#include +#include "SH1106Wire.h" +#include "SSD1306Wire.h" +#include "SH1106Spi.h" +#include "SSD1306Spi.h" +// =========================== // + +// ===================== LED CONFIG ==================== // +/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = + Uncomment the type of LED you're using + Only one of them can be defined at a time! + = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */ +//#define DIGITAL_LED +//#define RGB_LED +#define NEOPIXEL_LED + +/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = + Adjust following settings for your type of LED + you can ignore the rest of the #define's + = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */ +// === Settings for Digital LED === // +#define LED_ENABLE_R true +#define LED_ENABLE_G false +#define LED_ENABLE_B true + +// === Settings for Digital LED and RGB LED === // +#define LED_CATHODE false // common ground (GND) +#define LED_PIN_R 2 // ESP-12 LED +#define LED_PIN_G 0 +#define LED_PIN_B 16 // NodeMCU on-board LED + +// === Settings for RGB LED and Neopixel LED === // +#define LED_MODE_BRIGHTNESS 10 // brightness of LED modes +#define LED_DYNAMIC_BRIGHTNESS false // brightness in scan mode depending on packet rate and deauths per second + +// === Settings for Neopixel LED === // +#define LED_NEOPIXEL_NUM 1 +#define LED_NEOPIXEL_PIN 15 +// if it doesn't work try changing NEO_GRB to NEO_GRBW +#define LED_NEOPIXEL Adafruit_NeoPixel(LED_NEOPIXEL_NUM, LED_NEOPIXEL_PIN, NEO_GRB + NEO_KHZ800) + +// ===================== DISPLAY CONFIG ==================== // +#define USE_DISPLAY true // will force display on + +/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = + Adjust the pins to match your setup + Comment out the buttons you don't use. + = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */ +#define BUTTON_UP 12 +#define BUTTON_DOWN 13 +#define BUTTON_A 14 + +//#define BUTTON_LEFT 12 +//#define BUTTON_RIGHT 13 +//#define BUTTON_B 10 + +/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = + Uncomment the type of display you're using + Only one of them can be defined at a time! + = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = + 0x3c = I2C address + SDA = GPIO 5 (D1) + SCL/SCK = GPIO 4 (D2) */ +//#define DEAUTHER_DISPLAY SSD1306Wire display = SSD1306Wire(0x3c, 5, 4); // for 0.96" OLED +#define DEAUTHER_DISPLAY SH1106Wire display = SH1106Wire(0x3c, 5, 4); // for 1.3" OLED + +/* RST = GPIO 5 (D1) + DC = GPIO 4 (D2) + CS = GPIO 15 (D8) or GND + SCK/SCL = GPIO 14 (D5) + SDA/MOSI = GPIO 13 (D7) */ +//#define DISPLAY SSD1306Spi display = SSD1306Spi display = SSD1306Spi(5, 4, 15); // for 0.96" OLED with SPI +//#define DISPLAY SH1106Spi display = SH1106Spi(5, 4); // for 1.3" OLED with SPI +// ========================================================= // + +#endif \ No newline at end of file diff --git a/configs/deauther_boy.txt b/configs/deauther_boy.txt new file mode 100644 index 0000000..7c56c09 --- /dev/null +++ b/configs/deauther_boy.txt @@ -0,0 +1,80 @@ +#ifndef config_h +#define config_h + +// ===== DISPLAY LIBRARY ===== // +#include +#include +#include "SH1106Wire.h" +#include "SSD1306Wire.h" +#include "SH1106Spi.h" +#include "SSD1306Spi.h" +// =========================== // + +// ===================== LED CONFIG ==================== // +/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = + Uncomment the type of LED you're using + Only one of them can be defined at a time! + = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */ +//#define DIGITAL_LED +//#define RGB_LED +#define NEOPIXEL_LED + +/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = + Adjust following settings for your type of LED + you can ignore the rest of the #define's + = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */ +// === Settings for Digital LED === // +#define LED_ENABLE_R true +#define LED_ENABLE_G false +#define LED_ENABLE_B true + +// === Settings for Digital LED and RGB LED === // +#define LED_CATHODE false // common ground (GND) +#define LED_PIN_R 2 // ESP-12 LED +#define LED_PIN_G 0 +#define LED_PIN_B 16 // NodeMCU on-board LED + +// === Settings for RGB LED and Neopixel LED === // +#define LED_MODE_BRIGHTNESS 10 // brightness of LED modes +#define LED_DYNAMIC_BRIGHTNESS false // brightness in scan mode depending on packet rate and deauths per second + +// === Settings for Neopixel LED === // +#define LED_NEOPIXEL_NUM 1 +#define LED_NEOPIXEL_PIN 15 +// if it doesn't work try changing NEO_GRB to NEO_GRBW +#define LED_NEOPIXEL Adafruit_NeoPixel(LED_NEOPIXEL_NUM, LED_NEOPIXEL_PIN, NEO_GRB + NEO_KHZ800) + +// ===================== DISPLAY CONFIG ==================== // +#define USE_DISPLAY true // will force display on + +/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = + Adjust the pins to match your setup + Comment out the buttons you don't use. + = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */ +#define BUTTON_UP 10 +#define BUTTON_DOWN 9 +#define BUTTON_LEFT 0 +#define BUTTON_RIGHT 13 +#define BUTTON_A 14 +#define BUTTON_B 12 + +/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = + Uncomment the type of display you're using + Only one of them can be defined at a time! + = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = + 0x3c = I2C address + SDA = GPIO 5 (D1) + SCL/SCK = GPIO 4 (D2) */ +//#define DEAUTHER_DISPLAY SSD1306Wire display = SSD1306Wire(0x3c, 5, 4); // for 0.96" OLED +#define DEAUTHER_DISPLAY SH1106Wire display = SH1106Wire(0x3c, 5, 4); // for 1.3" OLED + +/* RST = GPIO 5 (D1) + DC = GPIO 4 (D2) + CS = GPIO 15 (D8) or GND + SCK/SCL = GPIO 14 (D5) + SDA/MOSI = GPIO 13 (D7) */ +//#define DISPLAY SSD1306Spi display = SSD1306Spi display = SSD1306Spi(5, 4, 15); // for 0.96" OLED with SPI +//#define DISPLAY SH1106Spi display = SH1106Spi(5, 4); // for 1.3" OLED with SPI +// ========================================================= // + +#endif \ No newline at end of file diff --git a/configs/default.txt b/configs/default.txt new file mode 100644 index 0000000..8068c9b --- /dev/null +++ b/configs/default.txt @@ -0,0 +1,81 @@ +#ifndef config_h +#define config_h + +// ===== DISPLAY LIBRARY ===== // +#include +#include +#include "SH1106Wire.h" +#include "SSD1306Wire.h" +#include "SH1106Spi.h" +#include "SSD1306Spi.h" +// =========================== // + +// ===================== LED CONFIG ==================== // +/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = + Uncomment the type of LED you're using + Only one of them can be defined at a time! + = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */ +#define DIGITAL_LED +//#define RGB_LED +//#define NEOPIXEL_LED + +/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = + Adjust following settings for your type of LED + you can ignore the rest of the #define's + = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */ +// === Settings for Digital LED === // +#define LED_ENABLE_R true +#define LED_ENABLE_G false +#define LED_ENABLE_B true + +// === Settings for Digital LED and RGB LED === // +#define LED_CATHODE false // common ground (GND) +#define LED_PIN_R 2 // ESP-12 LED +#define LED_PIN_G 0 +#define LED_PIN_B 16 // NodeMCU on-board LED + +// === Settings for RGB LED and Neopixel LED === // +#define LED_MODE_BRIGHTNESS 10 // brightness of LED modes +#define LED_DYNAMIC_BRIGHTNESS false // brightness in scan mode depending on packet rate and deauths per second + +// === Settings for Neopixel LED === // +#define LED_NEOPIXEL_NUM 1 +#define LED_NEOPIXEL_PIN 9 +// if it doesn't work try changing NEO_GRB to NEO_GRBW +#define LED_NEOPIXEL Adafruit_NeoPixel(LED_NEOPIXEL_NUM, LED_NEOPIXEL_PIN, NEO_GRB + NEO_KHZ800) + +// ===================== DISPLAY CONFIG ==================== // +#define USE_DISPLAY false // will force display on + +/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = + Adjust the pins to match your setup + Comment out the buttons you don't use. + = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */ +#define BUTTON_UP 14 +#define BUTTON_DOWN 12 +#define BUTTON_A 13 + +//#define BUTTON_LEFT 12 +//#define BUTTON_RIGHT 13 +//#define BUTTON_B 10 + +/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = + Uncomment the type of display you're using + Only one of them can be defined at a time! + = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = + 0x3c = I2C address + SDA = GPIO 5 (D1) + SCL/SCK = GPIO 4 (D2) */ +//#define DEAUTHER_DISPLAY SSD1306Wire display = SSD1306Wire(0x3c, 5, 4); // for 0.96" OLED +#define DEAUTHER_DISPLAY SH1106Wire display = SH1106Wire(0x3c, 5, 4); // for 1.3" OLED + +/* RST = GPIO 5 (D1) + DC = GPIO 4 (D2) + CS = GPIO 15 (D8) or GND + SCK/SCL = GPIO 14 (D5) + SDA/MOSI = GPIO 13 (D7) */ +//#define DISPLAY SSD1306Spi display = SSD1306Spi display = SSD1306Spi(5, 4, 15); // for 0.96" OLED with SPI +//#define DISPLAY SH1106Spi display = SH1106Spi(5, 4); // for 1.3" OLED with SPI +// ========================================================= // + +#endif \ No newline at end of file diff --git a/configs/diy_esp_boy.txt b/configs/diy_esp_boy.txt new file mode 100644 index 0000000..80f6db1 --- /dev/null +++ b/configs/diy_esp_boy.txt @@ -0,0 +1,81 @@ +#ifndef config_h +#define config_h + +// ===== DISPLAY LIBRARY ===== // +#include +#include +#include "SH1106Wire.h" +#include "SSD1306Wire.h" +#include "SH1106Spi.h" +#include "SSD1306Spi.h" +// =========================== // + +// ===================== LED CONFIG ==================== // +/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = + Uncomment the type of LED you're using + Only one of them can be defined at a time! + = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */ +//#define DIGITAL_LED +#define RGB_LED +//#define NEOPIXEL_LED + +/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = + Adjust following settings for your type of LED + you can ignore the rest of the #define's + = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */ +// === Settings for Digital LED === // +#define LED_ENABLE_R true +#define LED_ENABLE_G false +#define LED_ENABLE_B true + +// === Settings for Digital LED and RGB LED === // +#define LED_CATHODE false // common ground (GND) +#define LED_PIN_R 13 // D7 +#define LED_PIN_G 15 // D8 +#define LED_PIN_B 16 // D0 + +// === Settings for RGB LED and Neopixel LED === // +#define LED_MODE_BRIGHTNESS 1 // brightness of LED modes +#define LED_DYNAMIC_BRIGHTNESS false // brightness in scan mode depending on packet rate and deauths per second + +// === Settings for Neopixel LED === // +#define LED_NEOPIXEL_NUM 1 +#define LED_NEOPIXEL_PIN 9 +// if it doesn't work try changing NEO_GRB to NEO_GRBW +#define LED_NEOPIXEL Adafruit_NeoPixel(LED_NEOPIXEL_NUM, LED_NEOPIXEL_PIN, NEO_GRB + NEO_KHZ800) + +// ===================== DISPLAY CONFIG ==================== // +#define USE_DISPLAY true // will force display on + +/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = + Adjust the pins to match your setup + Comment out the buttons you don't use. + = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */ +#define BUTTON_UP 2 +#define BUTTON_DOWN 14 +#define BUTTON_A 10 + +#define BUTTON_LEFT 12 +#define BUTTON_RIGHT 0 +#define BUTTON_B 9 + +/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = + Uncomment the type of display you're using + Only one of them can be defined at a time! + = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = + 0x3c = I2C address + SDA = GPIO 5 (D1) + SCL/SCK = GPIO 4 (D2) */ +//#define DEAUTHER_DISPLAY SSD1306Wire display = SSD1306Wire(0x3c, 5, 4); // for 0.96" OLED +#define DEAUTHER_DISPLAY SH1106Wire display = SH1106Wire(0x3c, 5, 4); // for 1.3" OLED + +/* RST = GPIO 5 (D1) + DC = GPIO 4 (D2) + CS = GPIO 15 (D8) or GND + SCK/SCL = GPIO 14 (D5) + SDA/MOSI = GPIO 13 (D7) */ +//#define DISPLAY SSD1306Spi display = SSD1306Spi display = SSD1306Spi(5, 4, 15); // for 0.96" OLED with SPI +//#define DISPLAY SH1106Spi display = SH1106Spi(5, 4); // for 1.3" OLED with SPI +// ========================================================= // + +#endif \ No newline at end of file diff --git a/esp8266_deauther/APScan.cpp b/esp8266_deauther/APScan.cpp deleted file mode 100644 index 338925d..0000000 --- a/esp8266_deauther/APScan.cpp +++ /dev/null @@ -1,314 +0,0 @@ -#include "APScan.h" - -APScan::APScan() { - -} - -bool APScan::start() { - if (debug) { - Serial.println("starting AP scan..."); - Serial.println("MAC - Ch - RSSI - Encrypt. - SSID - Hidden");// - Vendor"); - } - aps._clear(); - results = 0; - for (int i = 0; i < maxAPScanResults; i++){ - selected[i] = false; - String("").toCharArray(names[i], 33); - } - results = WiFi.scanNetworks(false, settings.apScanHidden); // lets scanNetworks return hidden APs. (async = false & show_hidden = true) - if(results > maxAPScanResults) results = maxAPScanResults; - - if (debug) Serial.println("Scan results: "+(String)results); - - for (int i = 0; i < results && i < maxAPScanResults; i++) { - Mac _ap; - _ap.set(WiFi.BSSID(i)[0], WiFi.BSSID(i)[1], WiFi.BSSID(i)[2], WiFi.BSSID(i)[3], WiFi.BSSID(i)[4], WiFi.BSSID(i)[5]); - aps.add(_ap); - channels[i] = WiFi.channel(i); - rssi[i] = WiFi.RSSI(i); - encryption[i] = WiFi.encryptionType(i); - hidden[i] = WiFi.isHidden(i); - String _ssid = WiFi.SSID(i); - _ssid.toCharArray(names[i], 33); - //data_getVendor(WiFi.BSSID(i)[0],WiFi.BSSID(i)[1],WiFi.BSSID(i)[2]).toCharArray(vendors[i],9); - if (debug) { - Serial.print((String)i); - Serial.print(" - "); - _ap._print(); - Serial.print(" - "); - Serial.print(channels[i]); - Serial.print(" - "); - Serial.print(rssi[i]); - Serial.print(" - "); - Serial.print(getEncryption(encryption[i])); - Serial.print(" - "); - Serial.print(names[i]); - Serial.print(" - "); - Serial.print(hidden[i]); - //Serial.print(" - "); - //Serial.print(vendors[i]); - Serial.println(); - } - } - - //for debugging the APScan crash bug - /* - if(debug){ - for(int i=results;i