Skip to content

intelligent-ears/esp32_timing-attack_simulation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

16 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ”“ ESP32 Precise Timing Side-Channel Attack

This repository demonstrates a practical timing side-channel attack using an ESP32 as the attacker and an ESP8266 as the vulnerable target. The attacker deduces a secret password character-by-character by analyzing response time variations over Wi-Fi.


πŸš€ Project Structure

architecture



🎯 Objective

Extract a secret password (e.g., secret42) from the ESP8266
using only timing variations in its response to login attempts.


πŸ› οΈ Requirements

Hardware

  • πŸ”Ή ESP32 (e.g., DevKit V1)
  • πŸ”Ή ESP8266 (e.g., NodeMCU)
  • πŸ”Ή Shared Wi-Fi connection

Software

  • Arduino IDE with:
    • ESP32 board package
    • ESP8266 board package
  • Python 3.7+
    • matplotlib
    • pandas

Install dependencies:

pip install matplotlib pandas

πŸ”„ Attack Flow

  1. ESP32 connects to Wi-Fi and targets the ESP8266 server.
  2. It sends login attempts with different guesses at each character position.
  3. Measures the time taken for each response using micros().
  4. Builds a statistical profile of response times per character.
  5. Chooses the character with the highest average time as the likely correct one.
  6. Repeats for each subsequent position until the full password is revealed.

πŸ›‘οΈ Defenses & Mitigations

  • Use constant-time string comparisons
  • Introduce artificial random delays
  • Perform rate-limiting and lockouts on repeated guesses
  • Avoid using strcmp() or similar early-return logic in auth routines

Β© 2025 intelligent-ears. All rights reserved.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published