Git Product home page Git Product logo

ets-polito / esp32-sniffer Goto Github PK

View Code? Open in Web Editor NEW
173.0 11.0 30.0 468 KB

ESP32 firmware that sniffs PROBE REQUEST packets sent from smartphones looking for a Wi-Fi connection in order to extract different types of information

Home Page: https://j4nn0.github.io/doc/ets_presentation.pdf

License: GNU General Public License v3.0

Makefile 1.49% CMake 0.59% C 94.99% Python 2.94%
esp32 esp32-wroom esp32-idf probe-requests sniffer multithreading mqtt spiffs sntp filesystem

esp32-sniffer's Introduction

ESP32 Sniffer

ETS

Software License Demo Twitter

This project is using Espressif IoT Development Framework (ESP-IDF) and has been tested on ESP-WROOM-32 module and esp-idf v3.2.

An overview of the full project (i.e. ESP32 firmware, server and GUI) can be found here.

This firmware is written with the purpose to sniff Probe Request packets sent by smartphones that are looking for Wi-Fi connection. When the Wi-Fi connection is active on a smartphone, it will send in broadcast (in all channels frequencies) a probe request messagge asking if there are any free Wi-Fi or some known ones (i.e. the smartphone knows the password for that Wi-Fi). The ESP32 will sniff it and extract different types of information.

The following information is taken from each sniffed packet:

  • MAC of the smartphone that has sent the request
  • SSID of the wifi to which the request is sent
  • The Timestamp of when the request was sent
  • Received Signal Strength Indicator (RSSI)
  • Sequence Number (SN)
  • HT Capabilities Info

After each minute these informations are sent to a server and processed. Finally, it is possible to see the processed informations (smartphones real time location, smartphone frequency, etc.) through a GUI.

Demo

Watch the video

Table of Contents

Firmware Overview

The firmware consits in two main threads/tasks:

  • Sniffer Task

    • Sniff Probe Request packet and save infomation described above into a file.
  • Wi-Fi Task

    • Each minute, take the information saved by the Sniffer Task and send it to the server.
    • A lock is used in order to manage critical section for I/O operations in the file.

The ESP32 is configured in WIFI_MODE_APSTA mode: i.e. it creates "soft-AP and station control block" and starts "soft-AP and station". Thanks to this, the ESP32 is able to sniff and send informations to the server at the same time avoiding to lose packets information while sending data.

Here is the full list of information fields that can be in a Probe Request (source IEEE 802.11-2012):

cwap-probe-10

And here below a packet sniffed with Wireshark in which you can see, for each field, the number of bits and their position within the packet:

cwap-probe-03

ESP-IDF Environment Configuration

This section might be outdated, checkout the official site for more info and for the latest guide on how to get started with ESP-IDF.

  1. Setup Toolchain

  2. Get ESP-IDF

    Besides the toolchain (that contains programs to compile and build the application), you also need ESP32 specific API / libraries.

    cd ~/esp
    git clone --recursive https://github.com/espressif/esp-idf.git
    
  3. Checkout to version v3.x

    cd esp-idf
    git checkout release/v3.2
    
  4. Setup path to ESP-IDF

    The toolchain programs access ESP-IDF using IDF_PATH environment variable. This variable should be set up on your PC, otherwise projects will not build.

  5. Install the Required Python Packages

    python -m pip install --user -r $IDF_PATH/requirements.txt
    

Usage

  1. Make sure you have exported the path

    export IDF_PATH=~/esp/esp-idf
    export PATH=$PATH:$HOME/esp/xtensa-esp32-elf/bin
    
  2. Clone the repo

    git clone https://github.com/ETS-PoliTO/esp32-sniffer.git
    cd esp32-sniffer
    
  3. Establish serial connection between ESP32 and your PC

    make menuconfig
    

    Go to Serial flasher config, then Default serial port and set the port in which ESP32 is connected

    Note that, if you are using a bridge, probably you need to download some driver:

    This provides a guide on how establish serial connection between ESP32 and PC.

  4. Build code and flash the ESP32

    make all && make flash
    
  5. See logs

    make monitor
    

File Configuration

The file /main/Kconfig.projbuild contains two different menus:

  • SPIFFS (SPI Flash File System)

    It contains some important information about the SPIFFS partion:

    • SPIFFS Base address
    • SPIFFS Size
    • SPIFFS Logical block size
    • SPIFFS Logical page size

    SPIFFS is a file system that supports wear leveling, file system consistency checks and more.

  • Configurations

    It contains different variables:

    • ESP32_ID: ID of the ESP32
    • WIFI_SSID: SSID of WiFi (network name)
    • WIFI_PASS: WiFi password (WPA or WPA2)
    • BROKER_ADDR: IP of the MQTT broker
    • BROKER_PSW: password of the MQTT broker
    • BROKER_PORT: port of the MQTT broker
    • CHANNEL: channel in which ESP32 will sniff PROBE REQUEST
    • SNIFFING_TIME: time of sniffing
    • etc...

Variables Configuration

In order to configure the variables above:

  1. Open your terminal within the project folder and run

    make menuconfig 
    
  2. Select the menu you want to modify

  3. Edit variables as you like

Add Customised Menu

You can also add different menus with different variables:

  1. Open Kconfig.projbuild

  2. Start a new menu

    menu YOUR_MENU_NAME
    
  3. Add the variables you need

  4. End menu

    endmenu
    

Components

Resources

Check also this demonstration video to see how ESP32 works.

Seneca

Longum iter est per praecepta, breve et efficax per exempla

esp32-sniffer's People

Contributors

j4nn0 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

esp32-sniffer's Issues

Error post compile

the compilation succeeds, but in esp32-s2 the following error occurs.

I (6884) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (6884) wifi_init: rx ba win: 6
I (6894) wifi_init: tcpip mbox: 32
I (689Guru Meditation Error: Core 0 panic'ed (LoadProhibited). Exception was unhandled.
Core 0 register dump:
PC : 0x400014fd PS : 0x00060430 A0 : 0x80001459 A1 : 0x3ffcb710
A2 : 0x00001f98 A3 : 0x00001f94 A4 : 0x000000ff A5 : 0x0000ff00
A6 : 0x00ff0000 A7 : 0xff000000 A8 : 0x00000000 A9 : 0x3ffcb6e0
A10 : 0x3ffcb920 A11 : 0x3ffcb660 A12 : 0x00000002 A13 : 0x3f405ba4
A14 : 0x00000002 A15 : 0x3ffcb584 SAR : 0x00000000 EXCCAUSE: 0x0000001c
EXCVADDR: 0x00001f98 LBEG : 0x400014fd LEND : 0x4000150d LCOUNT : 0xffffffff

ELF file SHA256: eb1c6fab31338c6c

ESP32 Firmware Version

Hi,

I am curious which ESP-IDF did you use for this project?
According to the path settings from the usage section, in the readme, I assume that you are using version 3.2.

Could you please confirm that?

ESP_ERROR_CHECK failed: esp_err_t 0x3005 (ESP_ERR_WIFI_MODE) at 0x400883d4

this is full uart data.
Can you help me?

[2023-02-09_19:32:26:227]ets Jun 8 2016 00:22:57

[2023-02-09_19:32:26:227]rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
[2023-02-09_19:32:26:227]configsip: 0, SPIWP:0xee
[2023-02-09_19:32:26:227]clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
[2023-02-09_19:32:26:227]mode:DIO, clock div:2
[2023-02-09_19:32:26:227]load:0x3fff0030,len:6620
[2023-02-09_19:32:26:227]ho 0 tail 12 room 4
[2023-02-09_19:32:26:227]load:0x40078000,len:14788
[2023-02-09_19:32:26:250]load:0x40080400,len:3792
[2023-02-09_19:32:26:250]entry 0x40080694
[2023-02-09_19:32:26:250]�[0;32mI (28) boot: ESP-IDF v4.4.1-dirty 2nd stage bootloader�[0m
[2023-02-09_19:32:26:250]�[0;32mI (28) boot: compile time 18:49:43�[0m
[2023-02-09_19:32:26:250]�[0;32mI (29) boot: chip revision: 1�[0m
[2023-02-09_19:32:26:250]�[0;32mI (32) boot_comm: chip revision: 1, min. bootloader chip revision: 0�[0m
[2023-02-09_19:32:26:273]�[0;32mI (39) boot.esp32: SPI Speed : 40MHz�[0m
[2023-02-09_19:32:26:273]�[0;32mI (44) boot.esp32: SPI Mode : DIO�[0m
[2023-02-09_19:32:26:273]�[0;32mI (48) boot.esp32: SPI Flash Size : 2MB�[0m
[2023-02-09_19:32:26:273]�[0;32mI (53) boot: Enabling RNG early entropy source...�[0m
[2023-02-09_19:32:26:295]�[0;32mI (58) boot: Partition Table:�[0m
[2023-02-09_19:32:26:295]�[0;32mI (62) boot: ## Label Usage Type ST Offset Length�[0m
[2023-02-09_19:32:26:295]�[0;32mI (69) boot: 0 nvs WiFi data 01 02 00009000 00006000�[0m
[2023-02-09_19:32:26:295]�[0;32mI (76) boot: 1 phy_init RF data 01 01 0000f000 00001000�[0m
[2023-02-09_19:32:26:316]�[0;32mI (84) boot: 2 factory factory app 00 00 00010000 00100000�[0m
[2023-02-09_19:32:26:316]�[0;32mI (91) boot: 3 storage Unknown data 01 82 00110000 000f0000�[0m
[2023-02-09_19:32:26:316]�[0;32mI (99) boot: End of partition table�[0m
[2023-02-09_19:32:26:357]�[0;32mI (103) boot_comm: chip revision: 1, min. application chip revision: 0�[0m
[2023-02-09_19:32:26:357]�[0;32mI (110) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=1c038h (114744) map�[0m
[2023-02-09_19:32:26:387]�[0;32mI (160) esp_image: segment 1: paddr=0002c060 vaddr=3ffb0000 size=03880h ( 14464) load�[0m
[2023-02-09_19:32:26:387]�[0;32mI (166) esp_image: segment 2: paddr=0002f8e8 vaddr=40080000 size=00730h ( 1840) load�[0m
[2023-02-09_19:32:26:387]�[0;32mI (167) esp_image: segment 3: paddr=00030020 vaddr=400d0020 size=9af04h (634628) map�[0m
[2023-02-09_19:32:26:658]�[0;32mI (404) esp_image: segment 4: paddr=000caf2c vaddr=40080730 size=13c1ch ( 80924) load�[0m
[2023-02-09_19:32:26:658]�[0;32mI (438) esp_image: segment 5: paddr=000deb50 vaddr=50000000 size=00010h ( 16) load�[0m
[2023-02-09_19:32:26:658]�[0;32mI (448) boot: Loaded app from partition at offset 0x10000�[0m
[2023-02-09_19:32:26:682]�[0;32mI (448) boot: Disabling RNG early entropy source...�[0m
[2023-02-09_19:32:26:682]�[0;32mI (460) cpu_start: Pro cpu up.�[0m
[2023-02-09_19:32:26:682]�[0;32mI (460) cpu_start: Starting app cpu, entry point is 0x40081188�[0m
[2023-02-09_19:32:26:682]�[0;32mI (0) cpu_start: App cpu up.�[0m
[2023-02-09_19:32:26:682]�[0;32mI (474) cpu_start: Pro cpu start user code�[0m
[2023-02-09_19:32:26:704]�[0;32mI (474) cpu_start: cpu freq: 160000000�[0m
[2023-02-09_19:32:26:704]�[0;32mI (474) cpu_start: Application information:�[0m
[2023-02-09_19:32:26:704]�[0;32mI (479) cpu_start: Project name: scan�[0m
[2023-02-09_19:32:26:704]�[0;32mI (484) cpu_start: App version: v4.4.1-dirty�[0m
[2023-02-09_19:32:26:704]�[0;32mI (489) cpu_start: Compile time: Feb 9 2023 19:10:07�[0m
[2023-02-09_19:32:26:726]�[0;32mI (495) cpu_start: ELF file SHA256: eae75b3db397f27b...�[0m
[2023-02-09_19:32:26:726]�[0;32mI (501) cpu_start: ESP-IDF: v4.4.1-dirty�[0m
[2023-02-09_19:32:26:726]�[0;32mI (507) heap_init: Initializing. RAM available for dynamic allocation:�[0m
[2023-02-09_19:32:26:749]�[0;32mI (514) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM�[0m
[2023-02-09_19:32:26:749]�[0;32mI (520) heap_init: At 3FFB7690 len 00028970 (162 KiB): DRAM�[0m
[2023-02-09_19:32:26:749]�[0;32mI (526) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM�[0m
[2023-02-09_19:32:26:749]�[0;32mI (532) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM�[0m
[2023-02-09_19:32:26:771]�[0;32mI (539) heap_init: At 4009434C len 0000BCB4 (47 KiB): IRAM�[0m
[2023-02-09_19:32:26:771]�[0;32mI (546) spi_flash: detected chip: generic�[0m
[2023-02-09_19:32:26:771]�[0;32mI (550) spi_flash: flash io: dio�[0m
[2023-02-09_19:32:26:771]�[0;33mW (554) spi_flash: Detected size(4096k) larger than the size in the binary image header(2048k). Using the size in the binary image header.�[0m
[2023-02-09_19:32:26:793]�[0;32mI (568) cpu_start: Starting scheduler on PRO CPU.�[0m
[2023-02-09_19:32:26:793]�[0;32mI (0) cpu_start: Starting scheduler on APP CPU.�[0m
[2023-02-09_19:32:26:793]�[0;32mI (577) ETS: [+] Startup...�[0m
[2023-02-09_19:32:26:823]�[0;32mI (597) ETS: [!] Starting blink task...�[0m
[2023-02-09_19:32:26:823]�[0;32mI (607) system_api: Base MAC address is not set�[0m
[2023-02-09_19:32:26:823]�[0;32mI (607) system_api: read default base MAC address from EFUSE�[0m
[2023-02-09_19:32:26:823]�[0;32mI (607) wifi_init: rx ba win: 6�[0m
[2023-02-09_19:32:26:845]�[0;32mI (607) wifi_init: tcpip mbox: 32�[0m
[2023-02-09_19:32:26:845]�[0;32mI (617) wifi_init: udp mbox: 6�[0m
[2023-02-09_19:32:26:845]�[0;32mI (617) wifi_init: tcp mbox: 6�[0m
[2023-02-09_19:32:26:845]�[0;32mI (617) wifi_init: tcp tx win: 5744�[0m
[2023-02-09_19:32:26:845]�[0;32mI (627) wifi_init: tcp rx win: 5744�[0m
[2023-02-09_19:32:26:845]�[0;32mI (627) wifi_init: tcp mss: 1436�[0m
[2023-02-09_19:32:26:895]�[0;32mI (627) wifi_init: WiFi IRAM OP enabled�[0m
[2023-02-09_19:32:26:895]�[0;32mI (637) wifi_init: WiFi RX IRAM OP enabled�[0m
[2023-02-09_19:32:26:895]�[0;32mI (647) phy_init: phy_version 4670,719f9f6,Feb 18 2021,17:07:07�[0m
[2023-02-09_19:32:26:990]�[0;32mI (757) ETS: Waiting for connection to the WiFi network...�[0m
[2023-02-09_19:32:26:990]�[0;32mI (757) ETS: [WI-FI] Connecting to LFin-2G�[0m
[2023-02-09_19:32:29:841]�[0;32mI (3597) ETS: [WI-FI] Disconnected�[0m
[2023-02-09_19:32:29:841]�[0;33mW (3597) ETS: [WI-FI] Impossible to connect to wifi: wrong password and/or SSID or Wi-Fi down�[0m
[2023-02-09_19:32:32:293]�[0;32mI (6047) ETS: [WI-FI] Disconnected�[0m
[2023-02-09_19:32:32:293]�[0;33mW (6047) ETS: [WI-FI] Impossible to connect to wifi: wrong password and/or SSID or Wi-Fi down�[0m
[2023-02-09_19:32:34:832]�[0;32mI (8597) esp_netif_handlers: sta ip: 192.168.219.40, mask: 255.255.255.0, gw: 192.168.219.1�[0m
[2023-02-09_19:32:34:832]�[0;32mI (8597) ETS: [WI-FI] Connected�[0m
[2023-02-09_19:32:34:973]�[0;32mI (8717) ETS: [SPIFFS] Partition size: total: 896321, used: 502�[0m
[2023-02-09_19:32:34:973]�[0;32mI (8717) ETS: Connecting to WiFi and getting time over NTP.�[0m
[2023-02-09_19:32:34:973]�[0;32mI (8717) ETS: Waiting for system time to be set... (1/15)�[0m
[2023-02-09_19:32:36:963]�[0;32mI (10727) ETS: Waiting for system time to be set... (2/15)�[0m
[2023-02-09_19:32:38:953]�[0;32mI (12727) ETS: TIME INFO: The Greenwich date/time is: Thu Feb 9 10:32:39 2023�[0m
[2023-02-09_19:32:38:953]�[0;32mI (12737) ETS: File /spiffs/probreq.log initialized�[0m
[2023-02-09_19:32:38:953]�[0;32mI (12737) ETS: File /spiffs/probreq2.log initialized�[0m
[2023-02-09_19:32:38:953]�[0;32mI (12737) ETS: [!] Starting sniffing task...�[0m
[2023-02-09_19:32:38:976]�[0;32mI (12737) ETS: [!] Starting Wi-Fi task...�[0m
[2023-02-09_19:32:38:976]�[0;32mI (12737) ETS: [SNIFFER] Sniffer task created�[0m
[2023-02-09_19:32:38:976]�[0;32mI (12747) ETS: [SNIFFER] Starting sniffing mode...�[0m
[2023-02-09_19:32:38:976]�[0;32mI (12747) ETS: [WIFI] Wi-Fi task created�[0m
[2023-02-09_19:32:38:976]�[0;33mW (12757) event: handler already registered, overwriting�[0m
[2023-02-09_19:32:38:998]�[0;31mE (12767) MQTT_CLIENT: Error parse uri = 192.168.219.201�[0m
[2023-02-09_19:32:38:998]�[0;33mW (12767) event: handler already registered, overwriting�[0m
[2023-02-09_19:32:38:998]�[0;32mI (12777) wifi_init: rx ba win: 6�[0m
[2023-02-09_19:32:38:998]�[0;33mW (12777) MQTT_CLIENT: Client asked to stop, but was not started�[0m
[2023-02-09_19:32:39:020]�[0;31mE (12787) MQTT_CLIENT: Client was not initialized�[0m
[2023-02-09_19:32:39:020]�[0;32mI (12787) wifi_init: tcpip mbox: 32�[0m
[2023-02-09_19:32:39:020]�[0;32mI (12797) wifi_init: udp mbox: 6�[0m
[2023-02-09_19:32:39:020]�[0;32mI (12797) wifi_init: tcp mbox: 6�[0m
[2023-02-09_19:32:39:043]�[0;32mI (12797) ETS: [MQTT] Connecting to 192.168.219.201:1883�[0m
[2023-02-09_19:32:39:043]�[0;32mI (12807) wifi_init: tcp tx win: 5744�[0m
[2023-02-09_19:32:39:043]�[0;32mI (12817) wifi_init: tcp rx win: 5744�[0m
[2023-02-09_19:32:39:043]�[0;32mI (12817) wifi_init: tcp mss: 1436�[0m
[2023-02-09_19:32:39:043]�[0;32mI (12827) wifi_init: WiFi IRAM OP enabled�[0m
[2023-02-09_19:32:39:065]�[0;32mI (12827) wifi_init: WiFi RX IRAM OP enabled�[0m
[2023-02-09_19:32:39:065]�[0;32mI (12837) ETS: [SNIFFER] Started. Sniffing on channel 11�[0m
[2023-02-09_19:32:39:065]�[0;32mI (12837) ETS: [WI-FI] Disconnected�[0m
[2023-02-09_19:32:39:065]ESP_ERROR_CHECK failed: esp_err_t 0x3005 (ESP_ERR_WIFI_MODE) at 0x400883d4
[2023-02-09_19:32:39:087]file: "../main/scan.c" line 238
[2023-02-09_19:32:39:087]func: event_handler
[2023-02-09_19:32:39:087]expression: esp_wifi_connect()

[2023-02-09_19:32:39:087]abort() was called at PC 0x400883d7 on core 0

[2023-02-09_19:32:39:087]Backtrace:0x40081a1a:0x3ffbbe900x400883e1:0x3ffbbeb0 0x4008ee4e:0x3ffbbed0 0x400883d7:0x3ffbbf40 0x400d7dee:0x3ffbbf60 0x400e7a25:0x3ffbbf80 0x401691c9:0x3ffbbfa0 0x40168c5a:0x3ffbbfd0 0x40168d35:0x3ffbc010 0x4008b56d:0x3ffbc030

[2023-02-09_19:32:39:110]ELF file SHA256: eae75b3db397f27b

[2023-02-09_19:32:39:110]Rebooting...
[2023-02-09_19:32:39:110]ets Jun 8 2016 00:22:57

ETS: [SNIFFER] Starting Guru Meditation Error

Hi,

(for the other issues - I am able to compile the project with the curent 3.3.5 branch of ESP-IDF)

Unfortunately I get the following error:

I (2737) ETS: [WI-FI] Connected
I (2827) ETS: [SPIFFS] Partition size: total: 896321, used: 502
I (2827) ETS: Connecting to WiFi and getting time over NTP.
I (2827) ETS: Waiting for system time to be set... (1/15)
I (4837) ETS: TIME INFO: The Greenwich date/time is: Fri Sep 10 11:27:38 2021
I (4877) ETS: File /spiffs/probreq.log initialized
I (4887) ETS: File /spiffs/probreq2.log initialized
I (4887) ETS: [!] Starting sniffing task...
I (4887) ETS: [!] Starting Wi-Fi task...
I (4887) ETS: [SNIFFER] Sniffer task created
I (4897) ETS: [WIFI] Wi-Fi task created
I (4897) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (4907) ETS: [SNIFFER] Starting Guru Meditation Error: Core  0 panic'ed (LoadProhibited). Exception was unhandled.
Core 0 register dump:
PC      : 0x400014fd  PS      : 0x00060e30  A0      : 0x80001459  A1      : 0x3ffcb5e0  
A2      : 0x00000050  A3      : 0x0000004c  A4      : 0x000000ff  A5      : 0x0000ff00  
A6      : 0x00ff0000  A7      : 0xff000000  A8      : 0x00000000  A9      : 0x3ffcb5b0  
A10     : 0x3ffcb7f4  A11     : 0x3ffcb530  A12     : 0x00000002  A13     : 0x3f40583c  
A14     : 0x00000002  A15     : 0x3ffcb454  SAR     : 0x00000000  EXCCAUSE: 0x0000001c  
EXCVADDR: 0x00000050  LBEG    : 0x400014fd  LEND    : 0x4000150d  LCOUNT  : 0xffffffff

Can someone help?

Thanks in advance

directive writing 36 bytes into a region of size between 33 and 64 [-Werror=format-overflow=]

I'm getting the following error while running make all, and I have no Idea how to resolve this.

/home/kevin/esp/esp32-sniffer/components/espmqtt/lib/transport_ws.c: In function 'ws_connect':
/home/kevin/esp/esp32-sniffer/components/espmqtt/lib/transport_ws.c:100:53: error: '258EAFA5-E914-47DA-95CA-C5AB...' directive writing 36 bytes into a region of size between 33 and 64 [-Werror=format-overflow=]
     int key_len = sprintf((char*)client_key_b64, "%s258EAFA5-E914-47DA-95CA-C5AB0DC85B11", (char*)client_key);
                                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/kevin/esp/esp32-sniffer/components/espmqtt/lib/transport_ws.c:100:19: note: 'sprintf' output between 37 and 68 bytes into a destination of size 64
     int key_len = sprintf((char*)client_key_b64, "%s258EAFA5-E914-47DA-95CA-C5AB0DC85B11", (char*)client_key);
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
make[1]: *** [/home/kevin/esp/esp-idf/make/component_wrapper.mk:298: lib/transport_ws.o] Fehler 1
make: *** [/home/kevin/esp/esp-idf/make/project.mk:649: component-espmqtt-build] Fehler 2

I'm using Ubuntu 20.04

grafik

Help in converting code please

Hi, nice code you have here... This code seems to be run via power shell / cmd or python. If I want to run it on Arduino, this CONFIG_VERBOSE has to be changed but I have no idea how. Can someone please advice.

CMakeLists.txt not found in project directory

When I try to build the project with "idf.py build" I get the following error:
"CMakeLists.txt not found in project directory C:\esp\esp-idf\examples\esp32-sniffer".
How can I fix this?

ESP_ERR_WIFI_MODE reboot loop

Hi,

thanks for your code. Looks promising :)

Unfortunately I face a problem:

I (3271) ETS: [WI-FI] Connected
I (3361) ETS: [SPIFFS] Partition size: total: 896321, used: 502
I (3361) ETS: Connecting to WiFi and getting time over NTP.
I (3371) ETS: Waiting for system time to be set... (1/15)
I (5371) ETS: TIME INFO: The Greenwich date/time is: Fri Jan 18 19:55:20 2019
I (5381) ETS: File /spiffs/probreq.log initialized
I (5381) ETS: File /spiffs/probreq2.log initialized
I (5381) ETS: [!] Starting sniffing task...
I (5381) ETS: [!] Starting Wi-Fi task...
I (5381) ETS: [SNIFFER] Sniffer task created
I (5391) ETS: [SNIFFER] Starting sniffing mode...
I (5401) ETS: [WIFI] Wi-Fi task created
I (5401) ETS: [MQTT] Connecting to mqtt://X.X.X:X:1883
I (5411) ETS: [SNIFFER] Started. Sniffing on channel 11
I (5411) ETS: [WI-FI] Disconnected
SP_ERROR_CHECK failed: esp_err_t 0x3005 (ESP_ERR_WIFI_MODE) at 0x4008bf74
0x4008bf74: _esp_error_check_failed at /home/x/esp/esp-idf/components/esp32/panic.c:712

Does anyone has an idea?

Thanks in advance

problem with sniffer not detecting probes from some phones

hi I used the code and made a few changes to make it compatible with Arduino platform. I tested it using an esp32 wroom. it is also noteworthy to mention that I modified the sniffing time to 50. the problem is the code only detects the probe requests of my phone which is a Xiaomi Redmi note 11 pro but it doesn't detects the probe requests from older phones of my co-workers. what might be the problem here ?
thanks in advance

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.