mirror of
https://github.com/justcallmekoko/ESP32Marauder.git
synced 2026-08-02 17:08:34 -07:00
Select all and flipper LED
This commit is contained in:
@@ -463,24 +463,44 @@ void CommandLine::runCommand(String input) {
|
||||
// Get list of indices
|
||||
LinkedList<String> ap_index = this->parseCommand(cmd_args.get(ap_sw + 1), ",");
|
||||
|
||||
// Mark APs as selected
|
||||
for (int i = 0; i < ap_index.size(); i++) {
|
||||
int index = ap_index.get(i).toInt();
|
||||
if (!this->inRange(access_points->size(), index)) {
|
||||
Serial.println("Index not in range: " + (String)index);
|
||||
continue;
|
||||
// Select ALL APs
|
||||
if (cmd_args.get(ap_sw + 1) == "all") {
|
||||
for (int i = 0; i < access_points->size(); i++) {
|
||||
if (access_points->get(i).selected) {
|
||||
// Unselect "selected" ap
|
||||
AccessPoint new_ap = access_points->get(i);
|
||||
new_ap.selected = false;
|
||||
access_points->set(i, new_ap);
|
||||
}
|
||||
else {
|
||||
// Select "unselected" ap
|
||||
AccessPoint new_ap = access_points->get(i);
|
||||
new_ap.selected = true;
|
||||
access_points->set(i, new_ap);
|
||||
}
|
||||
}
|
||||
if (access_points->get(index).selected) {
|
||||
// Unselect "selected" ap
|
||||
AccessPoint new_ap = access_points->get(index);
|
||||
new_ap.selected = false;
|
||||
access_points->set(index, new_ap);
|
||||
}
|
||||
else {
|
||||
// Select "unselected" ap
|
||||
AccessPoint new_ap = access_points->get(index);
|
||||
new_ap.selected = true;
|
||||
access_points->set(index, new_ap);
|
||||
}
|
||||
// Select specific APs
|
||||
else {
|
||||
// Mark APs as selected
|
||||
for (int i = 0; i < ap_index.size(); i++) {
|
||||
int index = ap_index.get(i).toInt();
|
||||
if (!this->inRange(access_points->size(), index)) {
|
||||
Serial.println("Index not in range: " + (String)index);
|
||||
continue;
|
||||
}
|
||||
if (access_points->get(index).selected) {
|
||||
// Unselect "selected" ap
|
||||
AccessPoint new_ap = access_points->get(index);
|
||||
new_ap.selected = false;
|
||||
access_points->set(index, new_ap);
|
||||
}
|
||||
else {
|
||||
// Select "unselected" ap
|
||||
AccessPoint new_ap = access_points->get(index);
|
||||
new_ap.selected = true;
|
||||
access_points->set(index, new_ap);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -357,6 +357,9 @@ void WiFiScan::startWiFiAttacks(uint8_t scan_mode, uint16_t color, String title_
|
||||
esp_wifi_set_promiscuous(true);
|
||||
esp_wifi_set_max_tx_power(82);
|
||||
this->wifi_initialized = true;
|
||||
#ifdef MARAUDER_FLIPPER
|
||||
flipper_led.attackLED();
|
||||
#endif
|
||||
initTime = millis();
|
||||
}
|
||||
|
||||
@@ -369,6 +372,10 @@ bool WiFiScan::shutdownWiFi() {
|
||||
esp_wifi_set_mode(WIFI_MODE_NULL);
|
||||
esp_wifi_stop();
|
||||
esp_wifi_deinit();
|
||||
|
||||
#ifdef MARAUDER_FLIPPER
|
||||
flipper_led.offLED();
|
||||
#endif
|
||||
|
||||
this->wifi_initialized = false;
|
||||
return true;
|
||||
@@ -385,6 +392,10 @@ bool WiFiScan::shutdownBLE() {
|
||||
|
||||
pBLEScan->clearResults();
|
||||
BLEDevice::deinit();
|
||||
|
||||
#ifdef MARAUDER_FLIPPER
|
||||
flipper_led.offLED();
|
||||
#endif
|
||||
|
||||
this->ble_initialized = false;
|
||||
return true;
|
||||
@@ -499,6 +510,10 @@ void WiFiScan::RunAPScan(uint8_t scan_mode, uint16_t color)
|
||||
{
|
||||
sd_obj.openCapture("ap");
|
||||
|
||||
#ifdef MARAUDER_FLIPPER
|
||||
flipper_led.sniffLED();
|
||||
#endif
|
||||
|
||||
Serial.println(text_table4[9] + (String)access_points->size());
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.TOP_FIXED_AREA_2 = 48;
|
||||
@@ -728,6 +743,10 @@ void WiFiScan::RunInfo()
|
||||
void WiFiScan::RunEspressifScan(uint8_t scan_mode, uint16_t color) {
|
||||
sd_obj.openCapture("espressif");
|
||||
|
||||
#ifdef MARAUDER_FLIPPER
|
||||
flipper_led.sniffLED();
|
||||
#endif
|
||||
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.TOP_FIXED_AREA_2 = 48;
|
||||
display_obj.tteBar = true;
|
||||
@@ -757,6 +776,10 @@ void WiFiScan::RunEspressifScan(uint8_t scan_mode, uint16_t color) {
|
||||
|
||||
void WiFiScan::RunPacketMonitor(uint8_t scan_mode, uint16_t color)
|
||||
{
|
||||
#ifdef MARAUDER_FLIPPER
|
||||
flipper_led.sniffLED();
|
||||
#endif
|
||||
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.tft.init();
|
||||
display_obj.tft.setRotation(1);
|
||||
@@ -806,6 +829,10 @@ void WiFiScan::RunPacketMonitor(uint8_t scan_mode, uint16_t color)
|
||||
|
||||
void WiFiScan::RunEapolScan(uint8_t scan_mode, uint16_t color)
|
||||
{
|
||||
#ifdef MARAUDER_FLIPPER
|
||||
flipper_led.sniffLED();
|
||||
#endif
|
||||
|
||||
num_eapol = 0;
|
||||
|
||||
#ifdef HAS_SCREEN
|
||||
@@ -890,6 +917,10 @@ void WiFiScan::RunPwnScan(uint8_t scan_mode, uint16_t color)
|
||||
{
|
||||
sd_obj.openCapture("pwnagotchi");
|
||||
|
||||
#ifdef MARAUDER_FLIPPER
|
||||
flipper_led.sniffLED();
|
||||
#endif
|
||||
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.TOP_FIXED_AREA_2 = 48;
|
||||
display_obj.tteBar = true;
|
||||
@@ -922,6 +953,10 @@ void WiFiScan::RunBeaconScan(uint8_t scan_mode, uint16_t color)
|
||||
{
|
||||
sd_obj.openCapture("beacon");
|
||||
|
||||
#ifdef MARAUDER_FLIPPER
|
||||
flipper_led.sniffLED();
|
||||
#endif
|
||||
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.TOP_FIXED_AREA_2 = 48;
|
||||
display_obj.tteBar = true;
|
||||
@@ -953,6 +988,10 @@ void WiFiScan::RunDeauthScan(uint8_t scan_mode, uint16_t color)
|
||||
{
|
||||
sd_obj.openCapture("deauth");
|
||||
|
||||
#ifdef MARAUDER_FLIPPER
|
||||
flipper_led.sniffLED();
|
||||
#endif
|
||||
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.TOP_FIXED_AREA_2 = 48;
|
||||
display_obj.tteBar = true;
|
||||
@@ -986,6 +1025,10 @@ void WiFiScan::RunProbeScan(uint8_t scan_mode, uint16_t color)
|
||||
{
|
||||
sd_obj.openCapture("probe");
|
||||
|
||||
#ifdef MARAUDER_FLIPPER
|
||||
flipper_led.sniffLED();
|
||||
#endif
|
||||
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.TOP_FIXED_AREA_2 = 48;
|
||||
display_obj.tteBar = true;
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "TemperatureInterface.h"
|
||||
#include "settings.h"
|
||||
#include "Assets.h"
|
||||
#include "flipperLED.h"
|
||||
//#include "MenuFunctions.h"
|
||||
|
||||
#define bad_list_length 3
|
||||
@@ -74,6 +75,7 @@ extern Buffer buffer_obj;
|
||||
extern BatteryInterface battery_obj;
|
||||
extern TemperatureInterface temp_obj;
|
||||
extern Settings settings_obj;
|
||||
extern flipperLED flipper_led;
|
||||
|
||||
esp_err_t esp_wifi_80211_tx(wifi_interface_t ifx, const void *buffer, int len, bool en_sys_seq);
|
||||
//int ieee80211_raw_frame_sanity_check(int32_t arg, int32_t arg2, int32_t arg3);
|
||||
|
||||
@@ -4,14 +4,14 @@
|
||||
|
||||
#define POLISH_POTATO
|
||||
|
||||
#define MARAUDER_MINI
|
||||
//#define MARAUDER_MINI
|
||||
//#define MARAUDER_V4
|
||||
//#define MARAUDER_V6
|
||||
//#define MARAUDER_KIT
|
||||
//#define GENERIC_ESP32
|
||||
//#define MARAUDER_FLIPPER
|
||||
#define MARAUDER_FLIPPER
|
||||
|
||||
#define MARAUDER_VERSION "v0.9.10"
|
||||
#define MARAUDER_VERSION "v0.9.11"
|
||||
|
||||
//// BUTTON DEFINITIONS
|
||||
#ifdef MARAUDER_MINI
|
||||
|
||||
@@ -34,6 +34,7 @@ https://www.online-utility.org/image/convert/to/XBM
|
||||
#include "settings.h"
|
||||
#include "CommandLine.h"
|
||||
#include "lang_var.h"
|
||||
#include "flipperLED.h"
|
||||
|
||||
#ifdef HAS_SCREEN
|
||||
#include "Display.h"
|
||||
@@ -60,6 +61,7 @@ LedInterface led_obj;
|
||||
EspInterface esp_obj;
|
||||
Settings settings_obj;
|
||||
CommandLine cli_obj;
|
||||
flipperLED flipper_led;
|
||||
|
||||
#ifdef HAS_SCREEN
|
||||
Display display_obj;
|
||||
@@ -134,6 +136,10 @@ void setup()
|
||||
// Serial.println("Does not have screen");
|
||||
//#endif
|
||||
|
||||
#ifdef MARAUDER_FLIPPER
|
||||
flipper_led.RunSetup();
|
||||
#endif
|
||||
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.RunSetup();
|
||||
display_obj.tft.setTextColor(TFT_WHITE, TFT_BLACK);
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
#include "flipperLED.h"
|
||||
|
||||
void flipperLED::RunSetup() {
|
||||
pinMode(B_PIN, OUTPUT);
|
||||
pinMode(G_PIN, OUTPUT);
|
||||
pinMode(R_PIN, OUTPUT);
|
||||
|
||||
delay(50);
|
||||
|
||||
digitalWrite(B_PIN, LOW);
|
||||
delay(500);
|
||||
digitalWrite(B_PIN, HIGH);
|
||||
digitalWrite(G_PIN, LOW);
|
||||
delay(500);
|
||||
digitalWrite(G_PIN, HIGH);
|
||||
digitalWrite(R_PIN, LOW);
|
||||
delay(500);
|
||||
digitalWrite(R_PIN, HIGH);
|
||||
}
|
||||
|
||||
void flipperLED::attackLED() {
|
||||
digitalWrite(B_PIN, HIGH);
|
||||
digitalWrite(G_PIN, HIGH);
|
||||
digitalWrite(R_PIN, HIGH);
|
||||
delay(10);
|
||||
digitalWrite(R_PIN, LOW);
|
||||
}
|
||||
|
||||
void flipperLED::sniffLED() {
|
||||
digitalWrite(B_PIN, HIGH);
|
||||
digitalWrite(G_PIN, HIGH);
|
||||
digitalWrite(R_PIN, HIGH);
|
||||
delay(10);
|
||||
digitalWrite(B_PIN, LOW);
|
||||
}
|
||||
|
||||
void flipperLED::offLED() {
|
||||
digitalWrite(B_PIN, HIGH);
|
||||
digitalWrite(G_PIN, HIGH);
|
||||
digitalWrite(R_PIN, HIGH);
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
#ifndef flipperLED_h
|
||||
#define flipperLED_h
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
#define B_PIN 4
|
||||
#define G_PIN 5
|
||||
#define R_PIN 6
|
||||
|
||||
class flipperLED {
|
||||
|
||||
public:
|
||||
void RunSetup();
|
||||
void attackLED();
|
||||
void sniffLED();
|
||||
void offLED();
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user