ESP8266

How to Know WiFi Password Using ESP8266

Description:

How to Know WiFi Password Using ESP8266 – In this article, I am going to demonstrate how to retrieve WiFi passwords using the ESP8266 WiFi module, But before we get started, let me tell you.

how to know wifi password

Disclaimer:

allpcb circuit

This article is for educational purposes only. I do not promote or encourage any illegal activities, including phishing or hacking. Any techniques or methods discussed are intended to be used responsibly and ethically. Always respect others’ privacy and obtain proper permission before accessing any networks or devices. Remember, unauthorized access to WiFi networks or personal information is against the law and can have serious consequences. Please use the information in this article wisely!




A few days ago, I used a web portal to change the SSID and password on my ESP32 wirelessly. I not only saved the router’s WiFi credentials in the EEPROM, but I also managed to access those WiFi credentials from the EEPROM.

how to know wifi password

Right at this moment, an exciting idea came to my mind. I realized that someone could potentially retrieve the WiFi password of a nearby WiFi router or mobile hotspot. So, I decided to test this in a controlled environment to demonstrate how such a security vulnerability works and to show you how to protect yourself from it.

Remember, this is an educational demonstration meant to raise awareness about WiFi security.

So, without any further delay, let’s get started!



Amazon Links:

Nodemcu ESP8266 WiFi Module

SSD1306 Oled display Module

*Please Note: These are affiliate links. I may make a commission if you buy the components through these links. I would appreciate your support in this way!

First, let me explain how this works. When you go to manage Wi-Fi connections, you see a list of available networks. The top-most network, “Engr Fahad,” is the SSID of my WiFi router that I am currently connected to.

how to know wifi password

Two other networks, “Fawad” and “SherAlam,” are visible but not connected. Both networks show a lock icon, indicating they require a password. “Fawad” is the SSID of my brother’s mobile hotspot, and “SherAlam” is the SSID of my neighbor’s WiFi router.

how to know wifi password

For this demonstration, I created another WiFi network with the same SSID as my brother’s hotspot, “Fawad.” This can trick someone into clicking on the wrong network and entering their credentials, showing how attackers might exploit such vulnerabilities.

Let me stress again – never use this on someone’s network without their permission. It’s illegal and unethical.



Anyway, I am going to explain how attackers make a Fake WiFi network using ESP8266, well they can also use ESP32 or Raspberry Pi Pico, there are so many WiFi supported controller boards out there. But let’s focus on how they create a fake WiFi Network. You should know about this. 

ESP8266 Board Installation in the Arduino IDE:

I am using Nodemcu ESP8266 after a few months and I am not sure if the ESP8266 is still available in the boards list.

how to know wifi password

You can see ESP8266 is not available in the boards list. I have used it a lot but for the last few months I have been using ESP32 for all my IoT based projects.

Anyway, to install ESP8266 in the Arduino IDE, open this article “Nodemcu ESP8266 Arduino IDE Board Manager URL Link Installation and First Project”.

In this article, I have explained pretty much everything, if you are just getting started with the ESP8266, then you should read this article.

Anyway, you need to copy this URL link.

http://arduino.esp8266.com/stable/package_esp8266com_index.json

Again go to the Arduino IDE, go to the File Menu, and then to preferences.

installation of esp8266 board for how to know wifi password



Now,

  • Go to the Tools Menu, then Board, and click on the Boards Manager.
  • In the Search box, type esp8266.
  • Install ESP8266 by ESP8266 Community. Its going to take several minutes depending on the speed of your internet connection.

esp8266 board installation how to know wifi password

As you can see the ESP8266 package has been successfully installed and you can clearly see all the Boards included in this package. Now, let’s go ahead and confirm if the ESP8266 boards are available in the boards list.

So, let’s go to the Tools Menu and then to Board, you can see the ESP8266 Boards have been successfully installed.

esp8266 board installation how to know wifi password

I am going to connect my Nodemcu ESP8266 WiFi Module to the Laptop and then I can go ahead and upload this program.




Nodemcu ESP8266 Programming:

I actually downloaded this code from GitHub, I have slightly modified some code to make it work with my setup. I also added code for the SSD1306 Oled display Module. So, I also installed the two libraries.

<Adafruit_GFX.h>

#include <Adafruit_SSD1306.h>



Let me show you how to install these libraries in the Arduino IDE.

Copy the Library name.

Go to the Sketch Menu then to Include Library, and click on the Manage Libraries.

Paste the library name in the search box.

use adafruit gfx library for how to know wifi password

You can see I have already installed this library. Next, search for the SSD1306 library.

use adafruit ssd1306 library for how to know wifi password

I have also installed this library.

// Default SSID name

const char* SSID_NAME = “Fawad”;

This is my brother’s WiFi hotspot name, which I have set as the SSID for the network I created. I could leave it empty or write something else – I am not worried about this because I can change the SSID wirelessly at any time, without hard-coding.

#define BODY “Your router firmware is out of date. Update your firmware to continue browsing normally.”

The web portal will display a message asking him to update his router firmware – something that looks natural but is actually part of the trick.

I have already uploaded this program and now let me show you how this works in practice.

how to know wifi password

Now, you can see two networks with the same name, “Fawad,” in the list – one is the actual network, and the other is the fake network I created. Let me connect to this network to show you how the web portal actually looks on a laptop.



how to know wifi password

You can see the SSID and the update message. This looks so real. So, if you see something like this do not enter your password. Here is how it looks on a cell phone.

fake wifi firmware update using esp8266 for how to know wifi password

When someone connects to the fake WiFi network and enters the password, it’s saved in the ESP8266’s EEPROM.



You might wonder how I will know if my brother has entered the password. When the password is entered, the onboard LED will blink five times to notify me. I could also add a buzzer; however, to make it more user-friendly, I have added an I2C supported SSD1306 OLED display module to show the password directly on the screen.

how to know wifi password using esp8266 and ssd1306 oled display module

You can follow this circuit diagram.

how to know wifi password using esp8266 circuit diagram

On the Nodemcu ESP8266 WiFi module D1 is the SCL and D2 is the SDA.

how to know wifi password using esp8266

Now, there is no need to place this board in front of me, and I don’t need to keep checking the web portal either.

how to know wifi password

If he enters the password, it will be displayed on the OLED display module.

I have been waiting for several hours for my brother to enter the password, but he didn’t fall for it since he knew this trick. For the sake of demonstration, I eventually asked him to connect to this WiFi network; so you all could see how it actually works.




Finally, my brother connected to the fake WiFi network and entered his password. The password appeared on the OLED display, and I successfully completed the test.

how to know wifi password using esp8266

Now, to check the password on the web portal. In the code, there is an IP address.

192.1.1.1

If you go to this IP address and add /pass, you can check the password.

how to know wifi password using esp8266

You can also clear the entered password. It not only clears the password from the web portal but also from the EEPROM.

If you want to change the SSID, you can simply type /ssid and enter a new SSID name.

how to know wifi password using esp8266

I ran this demonstration in a controlled environment using my own WiFi networks, including a hotspot I set up with my brother’s name, “Fawad” I made up the story to illustrate how attackers could steal your WiFi credentials if you are not careful.

Always ensure that the network you connect to is the correct one. If you see a duplicate SSID, do not enter your WiFi credentials.

This technique should only be used for entering WiFi credentials wirelessly on the ESP8266 or ESP32 for legitimate purposes, such as IoT setups. Never use it to exploit someone else’s network.

I hope this article helps you understand how attackers can exploit WiFi networks and how to protect yourself. Remember, the goal is to educate and raise awareness, not to cause harm.



Watch Video Tutorial:

Engr Fahad

My name is Shahzada Fahad and I am an Electrical Engineer. I have been doing Job in UAE as a site engineer in an Electrical Construction Company. Currently, I am running my own YouTube channel "Electronic Clinic", and managing this Website. My Hobbies are * Watching Movies * Music * Martial Arts * Photography * Travelling * Make Sketches and so on...

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button