Skip to content

Commit

Permalink
Merge pull request #611 from justcallmekoko/develop
Browse files Browse the repository at this point in the history
Add more bluetooth stuff
  • Loading branch information
justcallmekoko authored Nov 25, 2024
2 parents 0dd1ca4 + d562086 commit a43ebfb
Show file tree
Hide file tree
Showing 12 changed files with 558 additions and 45 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ jobs:
uses: actions/checkout@v2
with:
repository: h2zero/NimBLE-Arduino
ref: 1.2.0
ref: 1.3.5
path: CustomNimBLE-Arduino

- name: Install Adafruit_NeoPixel
Expand Down
8 changes: 7 additions & 1 deletion esp32_marauder/Assets.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,13 @@ PROGMEM static const unsigned char menu_icons[][66] = {
0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0x3F},
{0xFF, 0xFF, 0xFD, 0xBF, 0x0B, 0xD0, 0xE7, 0xE7, 0xEF, 0xF7, 0xCF, 0xF3, // DISABLED TOUCH: 34
0xAF, 0xF5, 0x6F, 0xF6, 0x6F, 0xF6, 0xAF, 0xF5, 0xCF, 0xF3, 0x0F, 0xF0,
0xE7, 0xE7, 0x0B, 0xD0, 0xFD, 0xBF, 0xFF, 0xFF}
0xE7, 0xE7, 0x0B, 0xD0, 0xFD, 0xBF, 0xFF, 0xFF},
{0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0x3F, 0x0F, 0xFE, 0x3F, 0xF3, 0xF9, 0x3F, // FLIPPER: 35
0x8D, 0xF7, 0x3F, 0x7D, 0xEE, 0x3F, 0xC6, 0x2D, 0x38, 0xBB, 0x9D, 0x3B,
0xBB, 0x63, 0x38, 0x87, 0x3C, 0x3E, 0xFB, 0x0F, 0x3F, 0xFF, 0x81, 0x3F,
0xFF, 0x3F, 0x38, 0xFF, 0xFF, 0x3C, 0xFF, 0x07, 0x3E, 0xFF, 0xEB, 0x3F,
0xFF, 0xEF, 0x3F, 0xFF, 0xEF, 0x3F, 0xFF, 0xDF, 0x3F, 0xFF, 0xFF, 0x3F,
0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0x3F}
};

/*#ifndef MARAUDER_MINI
Expand Down
78 changes: 72 additions & 6 deletions esp32_marauder/CommandLine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ void CommandLine::runCommand(String input) {
Serial.println(HELP_LIST_AP_CMD_A);
Serial.println(HELP_LIST_AP_CMD_B);
Serial.println(HELP_LIST_AP_CMD_C);
Serial.println(HELP_LIST_AP_CMD_D);
Serial.println(HELP_SEL_CMD_A);
Serial.println(HELP_SSID_CMD_A);
Serial.println(HELP_SSID_CMD_B);
Expand All @@ -252,6 +253,7 @@ void CommandLine::runCommand(String input) {
#ifdef HAS_BT
Serial.println(HELP_BT_SNIFF_CMD);
Serial.println(HELP_BT_SPAM_CMD);
Serial.println(HELP_BT_SPOOFAT_CMD);
//Serial.println(HELP_BT_SWIFTPAIR_SPAM_CMD);
//Serial.println(HELP_BT_SAMSUNG_SPAM_CMD);
//Serial.println(HELP_BT_SPAM_ALL_CMD);
Expand Down Expand Up @@ -846,16 +848,73 @@ void CommandLine::runCommand(String input) {
// Bluetooth scan
if (cmd_args.get(0) == BT_SNIFF_CMD) {
#ifdef HAS_BT
Serial.println("Starting Bluetooth scan. Stop with " + (String)STOPSCAN_CMD);
#ifdef HAS_SCREEN
display_obj.clearScreen();
menu_function_obj.drawStatusBar();
#endif
wifi_scan_obj.StartScan(BT_SCAN_ALL, TFT_GREEN);
int bt_type_sw = this->argSearch(&cmd_args, "-t");

// Specifying type of bluetooth sniff
if (bt_type_sw != -1) {
String bt_type = cmd_args.get(bt_type_sw + 1);

bt_type.toLowerCase();

// Airtag sniff
if (bt_type == "airtag") {
Serial.println("Starting Airtag sniff. Stop with " + (String)STOPSCAN_CMD);
#ifdef HAS_SCREEN
display_obj.clearScreen();
menu_function_obj.drawStatusBar();
#endif
wifi_scan_obj.StartScan(BT_SCAN_AIRTAG, TFT_WHITE);
}
else if (bt_type == "flipper") {
Serial.println("Starting Flipper sniff. Stop with " + (String)STOPSCAN_CMD);
#ifdef HAS_SCREEN
display_obj.clearScreen();
menu_function_obj.drawStatusBar();
#endif
wifi_scan_obj.StartScan(BT_SCAN_FLIPPER, TFT_ORANGE);
}
}
// General bluetooth sniff
else {
Serial.println("Starting Bluetooth scan. Stop with " + (String)STOPSCAN_CMD);
#ifdef HAS_SCREEN
display_obj.clearScreen();
menu_function_obj.drawStatusBar();
#endif
wifi_scan_obj.StartScan(BT_SCAN_ALL, TFT_GREEN);
}
#else
Serial.println("Bluetooth not supported");
#endif
}
else if (cmd_args.get(0) == BT_SPOOFAT_CMD) {
int at_sw = this->argSearch(&cmd_args, "-t");
if (at_sw != -1) {
#ifdef HAS_BT
int target_mac = cmd_args.get(at_sw + 1).toInt();
if (target_mac < airtags->size()) {
for (int i = 0; i < airtags->size(); i++) {
AirTag at = airtags->get(i);
if (i == target_mac)
at.selected = true;
else
at.selected = false;
airtags->set(i, at);
}
Serial.println("Spoofing Airtag: " + airtags->get(target_mac).mac);
#ifdef HAS_SCREEN
display_obj.clearScreen();
menu_function_obj.drawStatusBar();
#endif
wifi_scan_obj.StartScan(BT_SPOOF_AIRTAG, TFT_WHITE);
}
else {
Serial.println("Provided index is out of range: " + (String)target_mac);
return;
}
#endif
}
}
else if (cmd_args.get(0) == BT_SPAM_CMD) {
int bt_type_sw = this->argSearch(&cmd_args, "-t");
if (bt_type_sw != -1) {
Expand Down Expand Up @@ -1072,6 +1131,7 @@ void CommandLine::runCommand(String input) {
int ap_sw = this->argSearch(&cmd_args, "-a");
int ss_sw = this->argSearch(&cmd_args, "-s");
int cl_sw = this->argSearch(&cmd_args, "-c");
int at_sw = this->argSearch(&cmd_args, "-t");

// List APs
if (ap_sw != -1) {
Expand Down Expand Up @@ -1118,6 +1178,12 @@ void CommandLine::runCommand(String input) {
}
this->showCounts(count_selected);
}
// List airtags
else if (at_sw != -1) {
for (int i = 0; i < airtags->size(); i++) {
Serial.println("[" + (String)i + "]MAC: " + airtags->get(i).mac);
}
}
else {
Serial.println("You did not specify which list to show");
return;
Expand Down
6 changes: 5 additions & 1 deletion esp32_marauder/CommandLine.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ extern WiFiScan wifi_scan_obj;
extern Settings settings_obj;
extern LedInterface led_obj;
extern LinkedList<AccessPoint>* access_points;
extern LinkedList<AirTag>* airtags;
extern LinkedList<ssid>* ssids;
extern LinkedList<Station>* stations;
extern const String PROGMEM version_number;
Expand Down Expand Up @@ -83,6 +84,7 @@ const char PROGMEM LOAD_CMD[] = "load";
// Bluetooth sniff/scan
const char PROGMEM BT_SPAM_CMD[] = "blespam";
const char PROGMEM BT_SNIFF_CMD[] = "sniffbt";
const char PROGMEM BT_SPOOFAT_CMD[] = "spoofat";
//const char PROGMEM BT_SOUR_APPLE_CMD[] = "sourapple";
//const char PROGMEM BT_SWIFTPAIR_SPAM_CMD[] = "swiftpair";
//const char PROGMEM BT_SAMSUNG_SPAM_CMD[] = "samsungblespam";
Expand Down Expand Up @@ -127,15 +129,17 @@ const char PROGMEM HELP_ATTACK_CMD[] = "attack -t <beacon [-l/-r/-a]/deauth [-c]
const char PROGMEM HELP_LIST_AP_CMD_A[] = "list -s";
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_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>]";
const char PROGMEM HELP_SSID_CMD_B[] = "ssid -r <index>";
const char PROGMEM HELP_SAVE_CMD[] = "save -a/-s";
const char PROGMEM HELP_LOAD_CMD[] = "load -a/-s";

// Bluetooth sniff/scan
const char PROGMEM HELP_BT_SNIFF_CMD[] = "sniffbt";
const char PROGMEM HELP_BT_SNIFF_CMD[] = "sniffbt [-t] <airtag/flipper>";
const char PROGMEM HELP_BT_SPAM_CMD[] = "blespam -t <apple/google/samsung/windows/flipper/all>";
const char PROGMEM HELP_BT_SPOOFAT_CMD[] = "spoofat -t <index>";
//const char PROGMEM HELP_BT_SOUR_APPLE_CMD[] = "sourapple";
//const char PROGMEM HELP_BT_SWIFTPAIR_SPAM_CMD[] = "swiftpair";
//const char PROGMEM HELP_BT_SAMSUNG_SPAM_CMD[] = "samsungblespam";
Expand Down
Loading

0 comments on commit a43ebfb

Please sign in to comment.