ESP-Sniffer 是一个实时 Wi-Fi 数据包嗅探器,利用 ESP32 以混杂模式捕获 802.11 帧,并通过 USB 串口以 PCAP 格式流式传输到 Python 主机工具,实现实时彩色解码与显示。

Stars

11

7 天增长

暂无数据

Fork 数

0

开放 Issue

0

开源协议

MIT

最近更新

2026-07-30

AI 仓库情报摘要
FR-AI / ANALYSIS

为什么值得关注

该项目以低成本、开源、跨平台的方式提供 802.11 帧捕获,支持自动端口检测、厂商名称解析和实时分类,非常适合学习和实验。

适合谁使用

  • 学习 Wi-Fi 协议的网络爱好者与爱好者
  • 在受控网络上进行无线分析的安全研究人员
  • 调试 Wi-Fi 设备行为的物联网开发者
  • 计算机网络或网络安全课程的学生

典型使用场景

  • 在自有网络中进行 Wi-Fi 监控用于教育目的
  • 分析信标帧以研究接入点行为
  • 通过嗅探流量调试自定义 Wi-Fi 设备或固件
  • 为研究捕获和检查 802.11 管理与控制帧

项目优势

  • 使用标准 PCAP 格式,便于与 Wireshark 等工具集成
  • 实时彩色终端输出,包含每包详情和周期性统计
  • 通过 USB VID/PID 和关键词自动检测 ESP32 串口,减少配置麻烦
  • 支持广泛的 802.11 帧类型,包括管理、控制和数据帧

使用前须知

  • 仅扫描 2.4 GHz 信道(1–13),每 500 毫秒跳频一次,无法捕获 5 GHz 且可能导致捕获不完整
  • 串口流速率 921600 波特,高流量下可能丢包
  • 需要有线 USB 连接和独立的 Python 环境,便携性受限

README 快速开始

ESP-Sniffer

A real-time Wi-Fi packet sniffer built on the ESP32. The ESP32 runs in promiscuous mode, captures raw 802.11 frames, and streams them over USB serial in PCAP format to a Python host tool that decodes, classifies, and displays them in a live color-coded terminal view.

System Architecture

The system is split into two halves:

  • ESP32 firmware — puts the Wi-Fi radio into promiscuous mode, hops channels every 500 ms, wraps every captured frame in a PCAP packet header, and streams the raw bytes over UART at 921600 baud.
  • Python host tool — syncs to the PCAP magic bytes, reads packet headers and frames, decodes the 802.11 control field, resolves vendor names from MAC addresses, and prints a live colored packet log with periodic statistics.

Live Output

Each line shows:

FieldDescription
[000001]Packet number
0.18sElapsed time since capture start
Management802.11 frame category (Management / Control / Data)
BeaconFrame subtype
len=318Captured frame length in bytes
src=...Source MAC address with vendor name
dst=...Destination MAC address with vendor name
bssid=...BSSID MAC address

Every 50 packets a summary line prints packet rate and top frame types.

Project Structure

ESP-Sniffer/
├── esp/
│   ├── esp.ino          # Arduino entry point (setup / loop)
│   ├── sniffer.cpp      # ESP32 promiscuous sniffer + PCAP serializer
│   └── sniffer.h        # Constants and function declarations
├── assets/
│   ├── logigrame.png    # System architecture diagram
│   └── screenshot.png   # Live terminal output screenshot
├── manuf.txt            # Wireshark OUI/vendor database
├── requirements.txt     # Python dependencies
└── sniffer.py           # Python host tool

Requirements

ESP32 Firmware

  • Arduino IDE or PlatformIO
  • ESP32 board support package
  • Board: any ESP32 development board (tested with CP2102 / CH340 USB-serial chips)

Python Host Tool

  • Python 3.8+

Install dependencies:

pip install -r requirements.txt
PackagePurpose
pyserialSerial communication with the ESP32
coloramaColored terminal output (cross-platform)
manufMAC address OUI vendor lookup
requestsDownloading updated Wireshark manuf database

Flashing the ESP32

  1. Open esp/esp.ino in

项目描述

A real-time Wi-Fi packet sniffer built on the ESP32.

相关仓库与替代方案

根据分类、Topic 和编程语言匹配的相似项目。

lopopolo
精选
lopopolo GitHub avatar

harness-engineering

Harness Engineering is a methodology for improving coding agent outputs by carefully crafting the environment around them—providing curated context, tools, and executable constraints that encode an organization’s nonfunctional requirements and cumulative lessons.

AI 与机器学习AI 智能体
2,390
slvDev
精选
slvDev GitHub avatar

esp32-ai

A 28.9 million parameter language model runs on an $8 ESP32-S3 microcontroller entirely on-device, generating simple stories at about 9.5 tokens per second.

AI 与机器学习大语言模型
1,960
littledivy
精选
littledivy GitHub avatar

mimic

mimic captures traffic from any iOS or web app and automatically generates a Python client library that lets you call the app's API like a regular library.

AI 与机器学习
1,482