Skip to content

About

BW16-Tools Beta fork: RTL8720DN Wi-Fi + BLE pentest firmware with GitHub Actions build (bare BW16-Kit / headless Web UI)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

15 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BW16-Pentest (BW16-Tools Beta fork)

GitHub-hosted build of BW16-Tools Beta (Wi‑Fi + BLE) for bare Ai-Thinker BW16-Kit (no OLED required).

CI build (no local Arduino needed)

  1. Push to main (or Actions → Build firmware → Run workflow).
  2. Download artifact bw16-tools-firmware-<sha> (or release tag latest-main).
  3. Flash: hold BURN, tap RST, release BURN, then use your flasher / Arduino upload with board Ai-Thinker BW16.

Board FQBN used in CI: realtek:AmebaD:Ai-Thinker_BW16 (AmebaD 3.1.7).

Web UI after boot: join AP BW16-WebUI / 1234567890 (edit src/BW16-Tools/web_config.h).

Upstream is archived; this tree is the Beta branch as of the fork point. License: GPL-3.0 (see LICENSE). Authorized security research only.


🛠️ BW16-Tools

Wireless security testing tool based on the Ai-Thinker BW16-Kit (RTL8720DN). Wi-Fi features: deauthentication (Deauth), channel interference, Deauth/Disassoc frame detection, password phishing (Phishing), authentication/association frame flood attack (DoS); BLE features: Bluetooth popup attacks, Bluetooth beacon broadcasting, and more. For security research and educational purposes only — do not abuse. Developed with Arduino.

2025-10-05

A new Beta branch was created, adding Bluetooth BLE functionality, but several bugs remain unresolved:

    1. Due to BW16 module design issues, Wi-Fi and BLE contend for resources, causing abnormal behavior in some cases.
    1. BLE functionality is suspected to cause severe memory overflow. (Affects packet capture; handshake packet buffering anomalies)

In this project, memory overflow and resource conflicts seem to have reached a delicate balance — most features work fine, but underlying issues remain. This is one reason these bugs are hard to fix.

Simply put, if you only need Wi-Fi features, use the older version on the main branch. If you are willing to give up Wi-Fi packet capture in exchange for Bluetooth BLE features, use the Beta branch version.

If you manage to fix these issues, contributions to this project are always welcome.

2026-09-23 (this fork)

Partial memory-pressure mitigations (upstream Beta OOM not fully fixed — hardware still has ~512KB RAM):

  • Free old handshake PCAP (globalPcapData) when starting a new capture; clear() + shrink_to_fit() on reset (previous capture is discarded if you start a new one)
  • Handshake WebUI scan releases previous scan_results capacity before re-scan
  • BLE features tear down via performCompleteBleCleanup() (stop + end + deinit) on exit and before Web UI
  • /status includes pcap_size (current PCAP buffer length)
  • Phishing text list already capped (200 entries)

📌 Usage Notice

This project is intended for security research and educational purposes in compliance with applicable laws. Do not abuse it.

📑 Features

Wi-Fi Features

  • SSID/AP scanning [Scan]
    • Quick scan: normal active + passive scanning
    • Deep scan: multiple scan modes, channel-by-channel scanning
  • Deauthentication attack [Attack -> Deauth]
    • Sends deauthentication management frames to force clients to disconnect
    • WPA3 enforces protected management frames, so this is ineffective against WPA3 networks
  • Beacon frame attack [Attack -> Beacon]
    • Random beacon frame attack: sends large numbers of random beacon frames
    • Clone a specified AP: clones the beacon frame SSID transmitted by a specified AP
    • Selectable operating band 2.4G/5G
  • Password phishing [Phishing]
    • Selectable web page styles
  • Connection/channel interference [Channel Interference]
    • Clones beacon frames and probe responses from the target AP onto multiple channels
    • Clients cannot determine which channel the real AP is operating on, disrupting connections
    • Disrupts at the communication layer, ignoring WPA/WPA2/WPA3 and other security protocols
  • AP flood attack [DoS]
    • Sends large numbers of open authentication requests and association request frames with random MAC addresses to the target AP
    • Tested to be effective against lightweight home routers and portable Wi-Fi dongles; ineffective against phone hotspots
  • Attack frame detection [Detect]
    • Listens for Deauth/Disassoc frames on a specified channel
    • Selectable channel group (2.4G/5G/all/common)
    • Intelligently records access points suspected of being attacked
    • (However, it is not very intelligent — it records some useless content)
  • Monitor [Monitor]
    • Counts valid packets on a specified channel
    • Generates real-time charts and statistics
    • A "[*]" indicator appears in the top-right corner when deauthentication/association frames are detected
  • Web UI
    • Custom SSID beacon frame attack [Custom Beacon]
    • WPA/WPA2 handshake capture [Handshake Capture] (completely broken in the Beta version)

BLE Features

  • Bluetooth beacon broadcasting
    • Broadcasting: full Apple lineup, full Xiaomi lineup, full Huawei lineup, full Google lineup, mixed Mi Home devices, rare devices, children's toys
    • Broadcasts large numbers of Bluetooth devices from the corresponding vendors; similar to Wi-Fi beacon frame attacks — sends only beacon data, cannot be connected to
  • Bluetooth popup attacks
    • iOS Quick Pair popup
    • iOS Action Modal
    • iOS 17 crash attack (suspected fixed)
    • Windows Swift Pair popup
    • Quick Pair popup for older Android devices

📟 OLED UI

UI

🔗 Partial Code Sources

🧾 License

Licensed under the GPL 3.0 license. When using this project, please comply with:

  • Do not modify it and sell it as closed source
  • Do not use it in closed-source projects/products
  • Selling derivative products must retain the copyright and unconditionally provide source code (do not sell devices at high prices with this project's firmware as a selling point)

🧭 User Guide

Parts

  • Ai-Thinker BW16-Kit (RTL8720DN)
  • 0.96 OLED screen (SSD1315 / 1306)
  • Any buttons x 4
  • 3.7V lithium battery & charging module & power switch (optional)

Wiring

0.96 OLED BW16-Kit
GND GND
VCC 3V3
SCL PA25
SDA PA26
Button mapping BW16-Kit
BTN_UP (up) PA27
BTN_DOWN (down) PA12
BTN_OK (confirm) PA13
BTN_BACK (back) PB2

Connect one end of each button to the corresponding PA/PB pin on the BW16-Kit, and the other end to any GND pin on the BW16-Kit.

Button pin definitions can be changed in BW6-Tools.ino:

// Button pin definitions
#define BTN_DOWN PA12
#define BTN_UP PA27
#define BTN_OK PA13
#define BTN_BACK PB2

PCB Reference

PCB

PCB

BOM

  • Ai-Thinker BW16-Kit [x1]
  • 0.96 OLED (SSD1315 / 1306) [x1]
  • 4 * 4 * 1.8 tactile switch [x4]
    • 4 * 4 length/width, any height
  • SS12D07 G3 (8.8 * 4.5 * 3) slide switch [x1]
    • Vertical through-hole, 8.8 * 4.5 length/width, any lever length
  • 3.7V lithium battery 502030 [x1]
    • 5mm thick, 20mm wide, 30mm long
  • CL4056 3.7V lithium battery charging module [x1]
    • 16.8mm L * 12mm W

Flashing a precompiled bin

Go to Releases and download the compiled bin file, then flash it with any flashing tool

  • Before flashing, hold the Burn button on the BW16-Kit without releasing it, then tap the RST button once to enter download mode

Compiling and flashing yourself

  1. Install the BW16 board in Arduino IDE

Arduino_IDE_1

Arduino_IDE_2

  • Please install version 3.1.7!!!

Arduino_IDE_3

  1. Import local libraries
  • Import all library files in this repository's libraries directory, one by one

Arduino_IDE_4

  1. Compile the project and upload
  • Open /src/BW16-Tools/BW16-Tools.ino
  • Connect the BW16-Kit via USB
  • Hold the Burn button on the BW16-Kit without releasing it, then tap the RST button once to enter download mode
  • Compile and upload

Arduino_IDE_5

About

BW16-Tools Beta fork: RTL8720DN Wi-Fi + BLE pentest firmware with GitHub Actions build (bare BW16-Kit / headless Web UI)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages