Introduction: “Detect Wi-Fi Deauthentication Attack With the NodeMCU

In

recent years an efficient design of a Wireless Sensor Network has become a leading area of research. A Sensor is a device that responds and detects some type of input from both the physical or environmental conditions, such as pressure, heat, light, etc. The output of the sensor is generally an electrical signal that is transmitted to a controller for further processing.

A Wireless sensor network can be defined as a network of devices that can communicate the information gathered from a monitored field through wireless links. The data is forwarded through multiple nodes, and with a gateway, the data is connected to other networks like wireless Ethernet.

The most common Wi-Fi jamming attacks leverage deauthentication and disassociation packets to attack networks. This allows a low-cost ESP8266-based device programmed in Arduino to detect and classify Wi-Fi denial-of-service attacks by lighting a different color LED for each type of packet. The pattern of these colors can also allow us to fingerprint the tool being used to attack the network.

Supplies

Node MCU

buzzer

LED

bread board

jumper wires

Technologies used : Aurdiuno IDE

Step 1: Step 1 : Install and Configure Arduino IDE

Step 2: Step 2 : Setup the Board

Step 3: Step 3 : the Deauth Detector Code

#include

// First, we include the libraries we need to make this work on the ESP8266

const char* ssid = "Sanjeev Mishra";

const char* password = "123456789";

int wifiStatus;

int connectSuccess = 0, highTime = 100, lowtime = 100;

void red() {

digitalWrite(D5, HIGH), delay(highTime), digitalWrite(D5, LOW), delay(lowtime);

}

void green() {

digitalWrite(D6, HIGH), delay(highTime), digitalWrite(D6, LOW), delay(lowtime);

}

void blue() {

digitalWrite(D7, HIGH), delay(highTime), digitalWrite(D7, LOW), delay(lowtime);

}

void setup() {

pinMode(D5, OUTPUT), pinMode(D6, OUTPUT), pinMode(D7, OUTPUT);

WiFi.begin(ssid, password);

}

void loop() {

wifiStatus = WiFi.status();

if(connectSuccess == 0){ blue();}

if(wifiStatus == WL_CONNECTED){ green(), connectSuccess ++;}

else if(connectSuccess != 0){ red(); }

delay(1000);

}

Step 4: Step 4 : Wire & Test the Modified DeauthDetector

d5: red led

d6: green led

d7: blue led

and ground

Step 5: Step 5: Test by Attempting Deauthentication Attack