Hackers and manufacturers are often grouped under the same label. While hackers rely on computer literacy to write programs and find bugs, manufacturers use electrical engineering to create hardware prototypes from microprocessor boards such as the Arduino. We both practice abilities to program a $ 6 NodeMCU to indicate the status of a Wi-Fi connection via an LED so that we can monitor for jamming attacks.
While it's easy to launch attacks against Wi-Fi Most attacks are relatively simple. Under normal circumstances, IoT devices can easily connect to a Wi-Fi network and perform useful functions. During a jamming attack, devices such as smart speakers or connected Wi-Fi cameras are the most vulnerable because they do not have a backup Ethernet connection.
To detect such attacks, we can use a low-cost IoT device such as a NodeMCU, a "canary in a coal mine," to warn us when the connection to a particular Wi-Fi network becomes impossible. Instead of looking for upstream connectivity, we program a simple detector that attempts to connect to a monitored Wi-Fi network and change an LED indicator to tell us whether a standard connection is not possible.
Designing the Detector  The first step in our project is to decide what our hardware prototype should do. Because most Wi-Fi related attacks abuse management frames to make a standard connection impossible, we can test the overall capability of devices by checking the Wi-Fi link of an IoT device. To keep things simple on our first project, we will create a link monitor focused on checking the ability of a Wi-Fi device to maintain a normal connection to a network. If this is not possible, we generate a warning message to warn you that there is a problem with the network.
Since we are not trying to establish and verify a network connection, there are some limitations to this tactic. First, we will not be alerted (or receive false positives) if the router is unable to connect to the Internet, but the Wi-Fi connection between the router and the detector is OK. Secondly, we are not looking for the telltale signs of deauthentication and dissociation frames; As we discuss this in a future build, the design we're going to do is going to be simpler and will also be triggered by more subtle jamming attacks.
Of course, if an attacker filters his jamming attacks to attack only other devices on the network and leaves the "canary" alone, then the detector always has a valid Wi-Fi connection and continues to signal that the connection is okay even if other devices can not connect.
In a future build, we will create a Deauthentication and Dissociation packet detector that is capable of detecting frequent Deauth attacks in the environment. For the moment, we will begin our journey as a manufacturer with a simpler design to understand how IoT programming works. We start with a look at the underlying hardware.
The ESP8266 Chip
The ESP8266 Wi-Fi radio chip is known among manufacturers for its intriguing combination of relatively high-performance, hackable hardware and a low price. Makers began noticing and documenting this chip, eventually allowing the ESP8266 to support the Arduino IDE. Simple Arduino-like devices that use this Wi-Fi radio can be easily programmed to do anything a manufacturer can imagine with Wi-Fi. Out of this chip have emerged some popular types of firmware, including the NodeMCU and the Arduino ESP8266 core.
An Arduino-like device that has become popular among manufacturers developing prototypes is the NodeMCU devkit 1.0. This cheap board, which I've seen somewhere between $ 5 and $ 9 apiece, is based on the ESP8266. It can be programmed in a variety of well-documented languages such as Arduino, Lua and MicroPython, so virtually anyone can start creating Wi-Fi-connected IoT devices that use a breadboard and any number of other electronics to control WIRELESS INTERNET ACCESS. By simply connecting a NodeMCU to a breadboard, a beginner can learn how to control and flash LED lights of different color combinations in just a few minutes.
Get It on Amazon: ESP8266 NodeMCU CP2102 Wi-Fi Internet Development Board Wireless Module
When a programmer writes his first program, it is common practice to write "Hello World" as the first output. In the maker community, the appropriate right of transition is to flash an LED. For our prototype we need the NodeMCU to tell us if it is no longer able to connect normally, which means we need an indicator that lets us know if there are connectivity issues. For this we can use the onboard LED on the NodeMCU, which is blue and turns on and off. Alternatively, we could use a tri-color RGB LED to give us some more options for our warning display.
In this guide, we'll use a four-pin RGB LED to blink blue if you're trying to find a connection in green if the connection is normal and red if the connection is disrupted or the network is degraded.
Parts Needed for This Manual
I have already stated the parts needed for this manual, but to make it super clear, here is what I used in the end:
There are several languages in which you can program a NodeMCU, and depending on your background, you can use what you're most comfortable with. In this guide, we will use the free and cross-platform Arduino IDE, which allows us to quickly prototype what we need. Arduino IDE (the IDE stands for "integrated development environment") enables fast writing and uploading of scripts to Arduino-like microcontroller devices.
You can download the Arduino IDE from the official website. Once you have downloaded and installed it, you will need to click on the "Arduino" drop-down menu and then select "Preferences" from the displayed menu.
In the following Settings menu, paste the following URL into the Additional Board Manager URLs box. Once this is done, click "OK" to close the menu.
Step 2: Configure the Arduino IDE for the ESP8266
Next, you must submit the NodeMCU to the Boards Manager Add. To do this, you need to click on "Tools" and then hover over the "Board" area to see the drop-down list of supported boards. Click on "Boards Manager" above to open the window where you can add more boards.
When the Boards Manager window pops up, type "esp8266" in the search bar. Select "esp8266" from "ESP8266 Community" and install it to add support for the NodeMCU to your Arduino IDE.
Ready, you should be ready to program your NodeMCU. Plug your breadboard to your computer where the NodeMCU should already be connected. If you click on "Tools", you should see the correct port automatically selected. Select the "NodeMCU 1.0" as shown in the picture below. If you use a faulty cable, the port may not be displayed. If you do not see anything after completing the other steps, try another cable first.
There are two main keys at the top. One compiles and checks our code for errors before uploading, and the second icon, which looks like an arrow, pushes the code to the NodeMCU.
Our first challenge is to get the NodeMCU to flash a particular color when we say it, and allow us to use an RGB LED to check the status of to display something we can not see – the Wi-Fi connection. Let's write a code to flash an LED!
The type of RGB LED we use is very easy to control. We have a ground pin that is longer than the other pins, and then a pin for each color, red, green, and blue.
If you look at the top of the NodeMCU, you will notice that the pins are labeled. The D0 to D8 pins can be programmed to drive an LED, while the GND (ground) pin connects the ground pin of the LED, the circuit close and light up the LED. We will connect the RGB LED next to the GND D5 D6 and D7 pins at the NodeMCU, with the longer pin with the position GND connected. We need to assign each pin to a color, so in our program, if we tell a pin that it's turned on, it will turn that particular color on.
To understand how a breadboard is used to connect pins, take a look at this image of the back of a full-sized breadboard. Here you can see that the rows are connected in the middle, while the columns at each edge are connected to apply current and ground.
Sie sollten sehen, dass die LED rot wird, sobald Ihr Angriff wirksam wird, und dann wieder grün wird, wenn der Angriff abklingt. Sie können die NodeMCU als "Opfer" -Gerät verwenden, um Jamming- und Deauthentifizierungsangriffe mit einer einfachen LED-Anzeige zu üben, um zu zeigen, wann Sie erfolgreich sind.
Erstaunliche Projekte sind mit der ESP8266 & Arduino IDE möglich
Bewaffnet mit niedrigen Kosten Board und Arduino IDE haben wir einen einfachen Code zur Überwachung einer Netzwerkverbindung erstellt und gezeigt, wie einfach es ist, eine kleine nützliche Funktion mit einem IoT-Gerät zu automatisieren. Neben der Erkennung von Angriffen kann der ESP8266 auch Netzwerke angreifen und wurde in Projekten eingesetzt, die von komplizierten LED-Masken bis hin zu kleinen Deauthentifizierungs-Paketgeneratoren wie dem von Spacehuhn  esp8266 reichen.
Mit so vielen kostengünstigen Gebäuden Blöcke wie die NodeMCU verfügbar, die mit Wi-Fi eingebaut sind, diese Geräte mit einem Netzwerk zu verbinden, um grundlegende nützliche Funktionen zu tun, ist selbst für einen beginnenden Hersteller einfach. Fortschrittlichere und kreativere Anwendungen dieser Bausteine können Netzwerke von zielgerichteten WLAN-Protokoll-Störsendern ermöglichen, um die Abdeckung über einen weiten Bereich zu verhindern, oder Detektoren zur Automatisierung der Wi-Fi-Überwachung.
Ich hoffe, Sie haben diesen Leitfaden zur Erkennung genossen Wi-Fi Jamming-Angriffe durch Programmierung einer NodeMCU in der Arduino IDE. Wenn Sie Fragen zu diesem Tutorial zur Arduino-Programmierung haben oder einen Kommentar haben, können Sie mich auf Twitter @KodyKinzie oder im Kommentar dazu erreichen.
Verpassen Sie nicht: Deaktivieren Sie Sicherheitskameras auf jedem drahtlosen Netzwerk mit Aireplay-ng