mirror of
https://github.com/justcallmekoko/ESP32Marauder.git
synced 2025-12-22 23:26:45 -08:00
stuff
This commit is contained in:
@@ -1,27 +0,0 @@
|
|||||||
#include "BatteryInterface.h"
|
|
||||||
|
|
||||||
BatteryInterface::BatteryInterface() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void BatteryInterface::RunSetup() {
|
|
||||||
Wire.begin(I2C_SDA, I2C_SCL);
|
|
||||||
}
|
|
||||||
|
|
||||||
int8_t BatteryInterface::getBatteryLevel() {
|
|
||||||
Wire.beginTransmission(IP5306_ADDR);
|
|
||||||
Wire.write(0x78);
|
|
||||||
if (Wire.endTransmission(false) == 0 &&
|
|
||||||
Wire.requestFrom(0x75, 1)) {
|
|
||||||
this->i2c_supported = true;
|
|
||||||
switch (Wire.read() & 0xF0) {
|
|
||||||
case 0xE0: return 25;
|
|
||||||
case 0xC0: return 50;
|
|
||||||
case 0x80: return 75;
|
|
||||||
case 0x00: return 100;
|
|
||||||
default: return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this->i2c_supported = false;
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
#ifndef BatteryInterface_h
|
|
||||||
#define BatteryInterface_h
|
|
||||||
|
|
||||||
#include <Wire.h>
|
|
||||||
|
|
||||||
#define I2C_SDA 33
|
|
||||||
#define I2C_SCL 22
|
|
||||||
#define IP5306_ADDR 0x75
|
|
||||||
|
|
||||||
class BatteryInterface {
|
|
||||||
private:
|
|
||||||
|
|
||||||
public:
|
|
||||||
int8_t battery_level = 0;
|
|
||||||
bool i2c_supported = false;
|
|
||||||
|
|
||||||
BatteryInterface();
|
|
||||||
|
|
||||||
void RunSetup();
|
|
||||||
int8_t getBatteryLevel();
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -233,21 +233,21 @@ void MenuFunctions::RunSetup()
|
|||||||
// Build WiFi sniffer Menu
|
// Build WiFi sniffer Menu
|
||||||
wifiSnifferMenu.parentMenu = &wifiMenu; // Main Menu is second menu parent
|
wifiSnifferMenu.parentMenu = &wifiMenu; // Main Menu is second menu parent
|
||||||
addNodes(&wifiSnifferMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this](){changeMenu(wifiSnifferMenu.parentMenu);});
|
addNodes(&wifiSnifferMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this](){changeMenu(wifiSnifferMenu.parentMenu);});
|
||||||
addNodes(&wifiSnifferMenu, "Probe Request Sniff", TFT_CYAN, NULL, PROBE_SNIFF, [this](){sd_obj.initSD(); wifi_scan_obj.StartScan(WIFI_SCAN_PROBE, TFT_CYAN);});
|
addNodes(&wifiSnifferMenu, "Probe Request Sniff", TFT_CYAN, NULL, PROBE_SNIFF, [this](){wifi_scan_obj.StartScan(WIFI_SCAN_PROBE, TFT_CYAN);});
|
||||||
addNodes(&wifiSnifferMenu, "Beacon Sniff", TFT_MAGENTA, NULL, BEACON_SNIFF, [this](){sd_obj.initSD(); wifi_scan_obj.StartScan(WIFI_SCAN_AP, TFT_MAGENTA);});
|
addNodes(&wifiSnifferMenu, "Beacon Sniff", TFT_MAGENTA, NULL, BEACON_SNIFF, [this](){wifi_scan_obj.StartScan(WIFI_SCAN_AP, TFT_MAGENTA);});
|
||||||
addNodes(&wifiSnifferMenu, "Deauth Sniff", TFT_RED, NULL, DEAUTH_SNIFF, [this](){sd_obj.initSD(); wifi_scan_obj.StartScan(WIFI_SCAN_DEAUTH, TFT_RED);});
|
addNodes(&wifiSnifferMenu, "Deauth Sniff", TFT_RED, NULL, DEAUTH_SNIFF, [this](){wifi_scan_obj.StartScan(WIFI_SCAN_DEAUTH, TFT_RED);});
|
||||||
|
|
||||||
// Build WiFi scanner Menu
|
// Build WiFi scanner Menu
|
||||||
wifiScannerMenu.parentMenu = &wifiMenu; // Main Menu is second menu parent
|
wifiScannerMenu.parentMenu = &wifiMenu; // Main Menu is second menu parent
|
||||||
addNodes(&wifiScannerMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this](){changeMenu(wifiScannerMenu.parentMenu);});
|
addNodes(&wifiScannerMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this](){changeMenu(wifiScannerMenu.parentMenu);});
|
||||||
addNodes(&wifiScannerMenu, "Packet Monitor", TFT_BLUE, NULL, PACKET_MONITOR, [this](){sd_obj.initSD(); wifi_scan_obj.StartScan(WIFI_PACKET_MONITOR, TFT_BLUE);});
|
addNodes(&wifiScannerMenu, "Packet Monitor", TFT_BLUE, NULL, PACKET_MONITOR, [this](){wifi_scan_obj.StartScan(WIFI_PACKET_MONITOR, TFT_BLUE);});
|
||||||
addNodes(&wifiScannerMenu, "EAPOL Scan", TFT_VIOLET, NULL, EAPOL, [this](){sd_obj.initSD(); wifi_scan_obj.StartScan(WIFI_SCAN_EAPOL, TFT_VIOLET);});
|
addNodes(&wifiScannerMenu, "EAPOL Scan", TFT_VIOLET, NULL, EAPOL, [this](){wifi_scan_obj.StartScan(WIFI_SCAN_EAPOL, TFT_VIOLET);});
|
||||||
|
|
||||||
// Build WiFi attack menu
|
// Build WiFi attack menu
|
||||||
wifiAttackMenu.parentMenu = &wifiMenu; // Main Menu is second menu parent
|
wifiAttackMenu.parentMenu = &wifiMenu; // Main Menu is second menu parent
|
||||||
addNodes(&wifiAttackMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this](){changeMenu(wifiAttackMenu.parentMenu);});
|
addNodes(&wifiAttackMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this](){changeMenu(wifiAttackMenu.parentMenu);});
|
||||||
addNodes(&wifiAttackMenu, "Beacon Spam Random", TFT_ORANGE, NULL, BEACON_SPAM, [this](){sd_obj.initSD(); wifi_scan_obj.StartScan(WIFI_ATTACK_BEACON_SPAM, TFT_ORANGE);});
|
addNodes(&wifiAttackMenu, "Beacon Spam Random", TFT_ORANGE, NULL, BEACON_SPAM, [this](){wifi_scan_obj.StartScan(WIFI_ATTACK_BEACON_SPAM, TFT_ORANGE);});
|
||||||
addNodes(&wifiAttackMenu, "Rick Roll Beacon", TFT_YELLOW, NULL, RICK_ROLL, [this](){sd_obj.initSD(); wifi_scan_obj.StartScan(WIFI_ATTACK_RICK_ROLL, TFT_YELLOW);});
|
addNodes(&wifiAttackMenu, "Rick Roll Beacon", TFT_YELLOW, NULL, RICK_ROLL, [this](){wifi_scan_obj.StartScan(WIFI_ATTACK_RICK_ROLL, TFT_YELLOW);});
|
||||||
|
|
||||||
// Build Bluetooth Menu
|
// Build Bluetooth Menu
|
||||||
bluetoothMenu.parentMenu = &mainMenu; // Second Menu is third menu parent
|
bluetoothMenu.parentMenu = &mainMenu; // Second Menu is third menu parent
|
||||||
@@ -258,17 +258,17 @@ void MenuFunctions::RunSetup()
|
|||||||
// Build bluetooth sniffer Menu
|
// Build bluetooth sniffer Menu
|
||||||
bluetoothSnifferMenu.parentMenu = &bluetoothMenu; // Second Menu is third menu parent
|
bluetoothSnifferMenu.parentMenu = &bluetoothMenu; // Second Menu is third menu parent
|
||||||
addNodes(&bluetoothSnifferMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this](){changeMenu(bluetoothSnifferMenu.parentMenu);});
|
addNodes(&bluetoothSnifferMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this](){changeMenu(bluetoothSnifferMenu.parentMenu);});
|
||||||
addNodes(&bluetoothSnifferMenu, "Bluetooth Sniffer", TFT_GREEN, NULL, BLUETOOTH_SNIFF, [this](){sd_obj.initSD(); wifi_scan_obj.StartScan(BT_SCAN_ALL, TFT_GREEN);});
|
addNodes(&bluetoothSnifferMenu, "Bluetooth Sniffer", TFT_GREEN, NULL, BLUETOOTH_SNIFF, [this](){wifi_scan_obj.StartScan(BT_SCAN_ALL, TFT_GREEN);});
|
||||||
|
|
||||||
// Build bluetooth scanner Menu
|
// Build bluetooth scanner Menu
|
||||||
bluetoothScannerMenu.parentMenu = &bluetoothMenu; // Second Menu is third menu parent
|
bluetoothScannerMenu.parentMenu = &bluetoothMenu; // Second Menu is third menu parent
|
||||||
addNodes(&bluetoothScannerMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this](){changeMenu(bluetoothScannerMenu.parentMenu);});
|
addNodes(&bluetoothScannerMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this](){changeMenu(bluetoothScannerMenu.parentMenu);});
|
||||||
addNodes(&bluetoothScannerMenu, "Detect Card Skimmers", TFT_MAGENTA, NULL, CC_SKIMMERS, [this](){sd_obj.initSD(); wifi_scan_obj.StartScan(BT_SCAN_SKIMMERS, TFT_MAGENTA);});
|
addNodes(&bluetoothScannerMenu, "Detect Card Skimmers", TFT_MAGENTA, NULL, CC_SKIMMERS, [this](){wifi_scan_obj.StartScan(BT_SCAN_SKIMMERS, TFT_MAGENTA);});
|
||||||
|
|
||||||
// General apps menu
|
// General apps menu
|
||||||
generalMenu.parentMenu = &mainMenu;
|
generalMenu.parentMenu = &mainMenu;
|
||||||
addNodes(&generalMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this](){display_obj.draw_tft = false; changeMenu(generalMenu.parentMenu);});
|
addNodes(&generalMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this](){display_obj.draw_tft = false; changeMenu(generalMenu.parentMenu);});
|
||||||
addNodes(&generalMenu, "Draw", TFT_WHITE, NULL, DRAW, [this](){sd_obj.initSD(); display_obj.clearScreen(); display_obj.draw_tft = true;});
|
addNodes(&generalMenu, "Draw", TFT_WHITE, NULL, DRAW, [this](){display_obj.clearScreen(); display_obj.draw_tft = true;});
|
||||||
|
|
||||||
// Device menu
|
// Device menu
|
||||||
deviceMenu.parentMenu = &mainMenu;
|
deviceMenu.parentMenu = &mainMenu;
|
||||||
@@ -309,7 +309,6 @@ void MenuFunctions::RunSetup()
|
|||||||
// Function to change menu
|
// Function to change menu
|
||||||
void MenuFunctions::changeMenu(Menu* menu)
|
void MenuFunctions::changeMenu(Menu* menu)
|
||||||
{
|
{
|
||||||
sd_obj.initSD();
|
|
||||||
display_obj.initScrollValues();
|
display_obj.initScrollValues();
|
||||||
display_obj.setupScrollArea(TOP_FIXED_AREA, BOT_FIXED_AREA);
|
display_obj.setupScrollArea(TOP_FIXED_AREA, BOT_FIXED_AREA);
|
||||||
display_obj.tft.init();
|
display_obj.tft.init();
|
||||||
|
|||||||
@@ -159,16 +159,7 @@ void SDInterface::performUpdate(Stream &updateSource, size_t updateSize) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SDInterface::main(uint32_t currentTime) {
|
void SDInterface::main() {
|
||||||
/*
|
|
||||||
if (currentTime != 0) {
|
|
||||||
if (currentTime - initTime >= 3000) {
|
|
||||||
//Serial.println("Checking for SD");
|
|
||||||
this->initTime = millis();
|
|
||||||
this->initSD();
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
|
|
||||||
if ((this->supported) && (this->do_save)) {
|
if ((this->supported) && (this->do_save)) {
|
||||||
//Serial.println("Saving packet...");
|
//Serial.println("Saving packet...");
|
||||||
buffer_obj.forceSave(&SD);
|
buffer_obj.forceSave(&SD);
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ class SDInterface {
|
|||||||
void openCapture(String file_name = "");
|
void openCapture(String file_name = "");
|
||||||
void runUpdate();
|
void runUpdate();
|
||||||
void performUpdate(Stream &updateSource, size_t updateSize);
|
void performUpdate(Stream &updateSource, size_t updateSize);
|
||||||
void main(uint32_t currentTime = 0);
|
void main();
|
||||||
//void savePacket(uint8_t* buf, uint32_t len);
|
//void savePacket(uint8_t* buf, uint32_t len);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -284,7 +284,7 @@ void WiFiScan::RunInfo()
|
|||||||
display_obj.tft.println(" SD Card: Not Connected");
|
display_obj.tft.println(" SD Card: Not Connected");
|
||||||
display_obj.tft.println("SD Card Size: 0");
|
display_obj.tft.println("SD Card Size: 0");
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
battery_obj.battery_level = battery_obj.getBatteryLevel();
|
battery_obj.battery_level = battery_obj.getBatteryLevel();
|
||||||
if (battery_obj.i2c_supported) {
|
if (battery_obj.i2c_supported) {
|
||||||
display_obj.tft.println(" IP5306 I2C: supported");
|
display_obj.tft.println(" IP5306 I2C: supported");
|
||||||
@@ -292,6 +292,7 @@ void WiFiScan::RunInfo()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
display_obj.tft.println(" IP5306 I2C: not supported");
|
display_obj.tft.println(" IP5306 I2C: not supported");
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
#include "Display.h"
|
#include "Display.h"
|
||||||
#include "SDInterface.h"
|
#include "SDInterface.h"
|
||||||
#include "Buffer.h"
|
#include "Buffer.h"
|
||||||
#include "BatteryInterface.h"
|
//#include "BatteryInterface.h"
|
||||||
//#include "MenuFunctions.h"
|
//#include "MenuFunctions.h"
|
||||||
|
|
||||||
#define bad_list_length 3
|
#define bad_list_length 3
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
extern Display display_obj;
|
extern Display display_obj;
|
||||||
extern SDInterface sd_obj;
|
extern SDInterface sd_obj;
|
||||||
extern Buffer buffer_obj;
|
extern Buffer buffer_obj;
|
||||||
extern BatteryInterface battery_obj;
|
//extern BatteryInterface battery_obj;
|
||||||
|
|
||||||
esp_err_t esp_wifi_80211_tx(wifi_interface_t ifx, const void *buffer, int len, bool en_sys_seq);
|
esp_err_t esp_wifi_80211_tx(wifi_interface_t ifx, const void *buffer, int len, bool en_sys_seq);
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ https://www.online-utility.org/image/convert/to/XBM
|
|||||||
#include "freertos/task.h"
|
#include "freertos/task.h"
|
||||||
#include "esp_system.h"
|
#include "esp_system.h"
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
#include <Preferences.h>
|
//#include <Preferences.h>
|
||||||
|
|
||||||
|
|
||||||
#include "Assets.h"
|
#include "Assets.h"
|
||||||
@@ -24,7 +24,7 @@ https://www.online-utility.org/image/convert/to/XBM
|
|||||||
#include "SDInterface.h"
|
#include "SDInterface.h"
|
||||||
#include "Web.h"
|
#include "Web.h"
|
||||||
#include "Buffer.h"
|
#include "Buffer.h"
|
||||||
#include "BatteryInterface.h"
|
//#include "BatteryInterface.h"
|
||||||
//#include "icons.h"
|
//#include "icons.h"
|
||||||
|
|
||||||
Display display_obj;
|
Display display_obj;
|
||||||
@@ -33,58 +33,27 @@ MenuFunctions menu_function_obj;
|
|||||||
SDInterface sd_obj;
|
SDInterface sd_obj;
|
||||||
Web web_obj;
|
Web web_obj;
|
||||||
Buffer buffer_obj;
|
Buffer buffer_obj;
|
||||||
BatteryInterface battery_obj;
|
//BatteryInterface battery_obj;
|
||||||
|
|
||||||
Preferences preferences;
|
//Preferences preferences;
|
||||||
|
|
||||||
uint32_t currentTime = 0;
|
uint32_t currentTime = 0;
|
||||||
|
|
||||||
void setup()
|
void setup()
|
||||||
{
|
{
|
||||||
Serial.begin(115200);
|
|
||||||
|
|
||||||
Serial.println("\n\n-------------------------------------\n");
|
//Serial.println("\n\n-------------------------------------\n");
|
||||||
|
|
||||||
pinMode(FLASH_BUTTON, INPUT);
|
pinMode(FLASH_BUTTON, INPUT);
|
||||||
pinMode(TFT_BL, OUTPUT);
|
pinMode(TFT_BL, OUTPUT);
|
||||||
digitalWrite(TFT_BL, LOW);
|
digitalWrite(TFT_BL, LOW);
|
||||||
|
|
||||||
preferences.begin("my-app", false);
|
|
||||||
|
|
||||||
unsigned int counter = preferences.getUInt("counter", 0);
|
|
||||||
|
|
||||||
if (counter == 0) {
|
|
||||||
counter++;
|
|
||||||
// Print the counter to Serial Monitor
|
|
||||||
Serial.printf("Current counter value: %u\n", counter);
|
|
||||||
|
|
||||||
// Store the counter to the Preferences
|
|
||||||
preferences.putUInt("counter", counter);
|
|
||||||
|
|
||||||
// Close the Preferences
|
|
||||||
preferences.end();
|
|
||||||
|
|
||||||
Serial.println("Initial reboot...");
|
|
||||||
|
|
||||||
ESP.restart();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
Serial.println("Initial reboot complete");
|
|
||||||
counter = 0;
|
|
||||||
// Print the counter to Serial Monitor
|
|
||||||
Serial.printf("Current counter value: %u\n", counter);
|
|
||||||
|
|
||||||
// Store the counter to the Preferences
|
|
||||||
preferences.putUInt("counter", counter);
|
|
||||||
|
|
||||||
// Close the Preferences
|
|
||||||
preferences.end();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Preset SPI CS pins to avoid bus conflicts
|
// Preset SPI CS pins to avoid bus conflicts
|
||||||
digitalWrite(TFT_CS, HIGH);
|
digitalWrite(TFT_CS, HIGH);
|
||||||
digitalWrite(SD_CS, HIGH);
|
digitalWrite(SD_CS, HIGH);
|
||||||
|
|
||||||
|
Serial.begin(115200);
|
||||||
|
|
||||||
Serial.println("\n\n--------------------------------\n");
|
Serial.println("\n\n--------------------------------\n");
|
||||||
Serial.println(" ESP32 Marauder \n");
|
Serial.println(" ESP32 Marauder \n");
|
||||||
Serial.println(" " + display_obj.version_number + "\n");
|
Serial.println(" " + display_obj.version_number + "\n");
|
||||||
@@ -102,16 +71,6 @@ void setup()
|
|||||||
|
|
||||||
// Build menus
|
// Build menus
|
||||||
menu_function_obj.RunSetup();
|
menu_function_obj.RunSetup();
|
||||||
|
|
||||||
battery_obj.RunSetup();
|
|
||||||
|
|
||||||
battery_obj.battery_level = battery_obj.getBatteryLevel();
|
|
||||||
|
|
||||||
if (battery_obj.i2c_supported) {
|
|
||||||
Serial.println("IP5306 I2C Supported: true");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
Serial.println("IP5306 I2C Supported: false");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -129,7 +88,7 @@ void loop()
|
|||||||
{
|
{
|
||||||
display_obj.main();
|
display_obj.main();
|
||||||
wifi_scan_obj.main(currentTime);
|
wifi_scan_obj.main(currentTime);
|
||||||
sd_obj.main(currentTime);
|
sd_obj.main();
|
||||||
//if ((wifi_scan_obj.currentScanMode != WIFI_ATTACK_BEACON_SPAM))
|
//if ((wifi_scan_obj.currentScanMode != WIFI_ATTACK_BEACON_SPAM))
|
||||||
if ((wifi_scan_obj.currentScanMode != WIFI_PACKET_MONITOR) &&
|
if ((wifi_scan_obj.currentScanMode != WIFI_PACKET_MONITOR) &&
|
||||||
(wifi_scan_obj.currentScanMode != WIFI_SCAN_EAPOL))
|
(wifi_scan_obj.currentScanMode != WIFI_SCAN_EAPOL))
|
||||||
|
|||||||
Reference in New Issue
Block a user