|
| 1 | +# Flipper Zero LAN Tester (W5500) |
| 2 | + |
| 3 | +[github](https://github.com/dok2d/fz-W5500-lan-analyse) |
| 4 | + |
| 5 | +Turn your **Flipper Zero + W5500 Lite** module into a professional-grade portable LAN tester. Analyze Ethernet links, discover network neighbors, scan subnets, fingerprint DHCP servers --- all from a pocket-sized device. |
| 6 | + |
| 7 | +--- |
| 8 | + |
| 9 | +## Features |
| 10 | + |
| 11 | +| Feature | Description | |
| 12 | +|---|---| |
| 13 | +| **Link Info** | PHY link status, speed (10/100 Mbps), duplex (Half/Full), MAC address, W5500 version check | |
| 14 | +| **DHCP Analyzer** | Discover-only analysis (no IP lease taken), option fingerprinting, full offer parsing | |
| 15 | +| **ARP Scanner** | Active subnet scan with batch requests, OUI vendor lookup (~120 vendors), duplicate detection | |
| 16 | +| **Ping** | Echo request/reply to any IP with configurable count and timeout | |
| 17 | +| **Continuous Ping** | Real-time RTT graph with min/max/avg and packet loss, configurable interval | |
| 18 | +| **DNS Lookup** | Resolve hostnames via UDP DNS, supports custom DNS server | |
| 19 | +| **Traceroute** | ICMP-based hop-by-hop path discovery, accepts IPs and hostnames with DNS resolve | |
| 20 | +| **Ping Sweep** | ICMP sweep of an entire subnet with interactive host list — click to ping, scan, or WOL | |
| 21 | +| **Port Scanner** | TCP connect scan: Top-20, Top-100 presets, or custom port range (1-65535) | |
| 22 | +| **LLDP/CDP** | Passive IEEE 802.1AB & Cisco CDP neighbor discovery with full TLV parsing | |
| 23 | +| **mDNS/SSDP** | Discover services and devices via multicast DNS and UPnP/SSDP | |
| 24 | +| **STP/VLAN** | Passive BPDU listener + 802.1Q VLAN tag detection | |
| 25 | +| **Statistics** | Frame counters by type (unicast/broadcast/multicast) and EtherType | |
| 26 | +| **Wake-on-LAN** | Send magic packets to any MAC address | |
| 27 | +| **Packet Capture** | Standalone PCAP traffic dump — capture raw Ethernet frames to .pcap file on SD card | |
| 28 | +| **ETH Bridge** | USB-to-Ethernet bridge: phone/PC gets LAN access via Flipper (CDC-ECM), optional PCAP traffic dump to SD card | |
| 29 | +| **PXE Server** | Minimal PXE boot server with built-in DHCP + TFTP, boots .kpxe/.efi files from SD card | |
| 30 | +| **File Manager** | Web-based file manager: browse, download, upload, delete files on microSD via HTTP from any browser on the LAN | |
| 31 | +| **History** | All scan results auto-saved with timestamps, browsable and deletable | |
| 32 | +| **Settings** | Auto-save, sound/vibro, custom DNS server, ping count/timeout/interval, clear history, MAC Changer | |
| 33 | + |
| 34 | +### UX Highlights |
| 35 | + |
| 36 | +- **Hierarchical menu**: features grouped into Network Info, Discovery, Diagnostics, Tools |
| 37 | +- **Link status in header**: see UP/DOWN, speed, duplex without entering Link Info |
| 38 | +- **DHCP caching**: single negotiation shared across all operations — no repeated 15s waits |
| 39 | +- **Visual progress**: countdown timers for listeners, ASCII progress bars for scans |
| 40 | +- **LED/vibro feedback**: green blink on success, red on error (optional, toggle in Settings) |
| 41 | +- **Smart defaults**: IP inputs pre-populated with DHCP gateway |
| 42 | + |
| 43 | +## Hardware |
| 44 | + |
| 45 | +### Required |
| 46 | + |
| 47 | +- **Flipper Zero** (OFW firmware) |
| 48 | +- **W5500 Lite** Ethernet module (or any W5500-based board with SPI) |
| 49 | + |
| 50 | +### Wiring |
| 51 | + |
| 52 | +``` |
| 53 | +W5500 Module Flipper Zero GPIO |
| 54 | +───────────── ───────────────── |
| 55 | +MOSI (MO) → A7 (pin 2) |
| 56 | +SCLK (SCK) → B3 (pin 5) |
| 57 | +CS (nSS) → A4 (pin 4) |
| 58 | +MISO (MI) → A6 (pin 3) |
| 59 | +RESET (RST) → C3 (pin 7) |
| 60 | +3V3 (VCC) → 3V3 (pin 9) |
| 61 | +GND (G) → GND (pin 8 or 11) |
| 62 | +``` |
| 63 | + |
| 64 | +> The W5500 is powered via Flipper's OTG 3.3V output, which is enabled automatically when the app starts. |
| 65 | +
|
| 66 | +## Usage |
| 67 | + |
| 68 | +1. Connect the W5500 module to Flipper Zero using the wiring diagram above |
| 69 | +2. Plug an Ethernet cable into the W5500's RJ45 port |
| 70 | +3. Open **GPIO → LAN Tester** on the Flipper |
| 71 | +4. The menu header shows link status (e.g. `LAN [UP 100M FD]`) |
| 72 | +5. Select a category and then a tool: |
| 73 | + |
| 74 | +### Network Info |
| 75 | +- **Link Info** — link status, speed, duplex, MAC. Use first to verify hardware. |
| 76 | +- **DHCP Analyze** — sends Discover, parses Offer. Does **not** take an IP lease. |
| 77 | +- **Statistics** — captures frames for 10s, shows breakdown by type and EtherType. |
| 78 | + |
| 79 | +### Discovery |
| 80 | +- **ARP Scan** — scans local subnet via DHCP-detected range, shows IP/MAC/vendor. |
| 81 | +- **Ping Sweep** — ICMP sweep of a CIDR range, auto-detected or manually entered. |
| 82 | +- **LLDP/CDP** — listens up to 60s for switch neighbor advertisements. |
| 83 | +- **mDNS/SSDP** — discovers services via multicast DNS and UPnP. |
| 84 | +- **STP/VLAN** — listens 30s for BPDU frames and 802.1Q VLAN tags. |
| 85 | + |
| 86 | +### Diagnostics |
| 87 | +- **Ping** — 4 pings to any IP (default: gateway from DHCP). |
| 88 | +- **Continuous Ping** — live RTT graph with loss tracking, runs until Back. |
| 89 | +- **DNS Lookup** — resolves a hostname via the DHCP-provided DNS server. |
| 90 | +- **Traceroute** — hop-by-hop ICMP path discovery up to 30 hops. |
| 91 | +- **Port Scan (Top 20/100)** — TCP connect scan of common ports. |
| 92 | + |
| 93 | +### Tools |
| 94 | +- **Wake-on-LAN** — send magic packet to wake a device by MAC address. |
| 95 | +- **ETH Bridge** — turns Flipper into a USB-to-Ethernet bridge. Phone/PC connects via USB (CDC-ECM), traffic is bridged to LAN via W5500 at Layer 2. The host gets an IP from the LAN's DHCP server transparently. Live stats show frame counts and link status. Press **OK** to start/stop PCAP traffic recording to SD card (Wireshark-compatible `.pcap` files saved to `apps_data/lan_tester/pcap/`). Press Back to stop and restore USB. |
| 96 | +- **PXE Server** — minimal PXE boot server. Configure Server/Client IP and subnet, toggle built-in DHCP server. Serves .kpxe/.efi boot files from SD card (`apps_data/lan_tester/pxe/`) via TFTP. Connect Flipper directly to target machine to network-boot it. |
| 97 | +- **File Manager** — starts an HTTP server on port 80. Open `http://<flipper-ip>/` in any browser on the LAN to browse the microSD card, download/upload files, create folders, and delete items. Flipper gets its IP via DHCP; the address is displayed on screen. |
| 98 | + |
| 99 | +### Settings |
| 100 | +- **Auto-save results** — ON/OFF, controls automatic history saving. |
| 101 | +- **Sound & vibro** — ON/OFF, controls LED/vibro notifications. |
| 102 | +- **Clear History** — delete all saved result files. |
| 103 | +- **MAC Changer** — generate random MAC or enter custom, saved to SD. |
| 104 | + |
| 105 | +## Technical Details |
| 106 | + |
| 107 | +- **W5500 MACRAW mode**: Socket 0 with `MFEN=0` (promiscuous --- receives all frames including multicast) |
| 108 | +- **Worker thread**: 8 KB stack, non-blocking UI via ViewDispatcher + worker pattern |
| 109 | +- **DHCP caching**: single negotiation, result reused across all subsequent operations |
| 110 | +- **Memory-safe**: large buffers heap-allocated, frame buffer on heap (4 KB app stack), bounds checking on all parsers |
| 111 | +- **Endianness**: manual big-endian parsing --- no float printf, no `htons`/`ntohs` |
| 112 | + |
| 113 | +## OUI Vendor Database |
| 114 | + |
| 115 | +The built-in lookup table covers ~120 common OUI prefixes including: |
| 116 | + |
| 117 | +> Cisco, HP/HPE, Dell, Intel, Broadcom, Realtek, Apple, Samsung, Huawei, TP-Link, Ubiquiti, Juniper, Arista, MikroTik, Netgear, ASUS, D-Link, Synology, QNAP, VMware, Microsoft, Google, Amazon, Lenovo, Supermicro, Aruba, Fortinet, Palo Alto, WIZnet, Raspberry Pi, Espressif, and more. |
| 118 | +
|
| 119 | +## Credits |
| 120 | + |
| 121 | +- Based on [arag0re/fz-eth-troubleshooter](https://github.com/arag0re/fz-eth-troubleshooter) (fork of [karasevia/finik_eth](https://github.com/karasevia/finik_eth)) |
| 122 | +- Uses [WIZnet ioLibrary_Driver](https://github.com/Wiznet/ioLibrary_Driver) for W5500 hardware abstraction |
| 123 | +- Built for [Flipper Zero OFW](https://github.com/flipperdevices/flipperzero-firmware) |
| 124 | + |
| 125 | +## License |
| 126 | + |
| 127 | +MIT License. See [LICENSE](LICENSE) for details. |
| 128 | + |
0 commit comments