Skip to content

Commit

Permalink
Merge pull request #427 from justcallmekoko/nmea
Browse files Browse the repository at this point in the history
Nmea
  • Loading branch information
justcallmekoko authored Dec 13, 2023
2 parents ee6defd + 1804a28 commit 9a36164
Show file tree
Hide file tree
Showing 25 changed files with 39,201 additions and 38,335 deletions.
2 changes: 2 additions & 0 deletions esp32_marauder/AXP192.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#pragma once

#ifndef __AXP192_H__
#define __AXP192_H__

Expand Down
2 changes: 2 additions & 0 deletions esp32_marauder/Assets.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#pragma once

#ifndef Assets_h
#define Assets_h

Expand Down
2 changes: 2 additions & 0 deletions esp32_marauder/BatteryInterface.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#pragma once

#ifndef BatteryInterface_h
#define BatteryInterface_h

Expand Down
2 changes: 2 additions & 0 deletions esp32_marauder/Buffer.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#pragma once

#ifndef Buffer_h
#define Buffer_h

Expand Down
147 changes: 135 additions & 12 deletions esp32_marauder/CommandLine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,15 +196,17 @@ void CommandLine::filterAccessPoints(String filter) {
}

void CommandLine::runCommand(String input) {
if (input != "")
Serial.println("#" + input);
if (input == "") return;

if(wifi_scan_obj.scanning() && wifi_scan_obj.currentScanMode == WIFI_SCAN_GPS_NMEA){
if(input != STOPSCAN_CMD) return;
}
else
return;
Serial.println("#" + input);

LinkedList<String> cmd_args = this->parseCommand(input, " ");

//// Admin commands

// Help
if (cmd_args.get(0) == HELP_CMD) {
Serial.println(HELP_HEAD);
Expand All @@ -217,6 +219,7 @@ void CommandLine::runCommand(String input) {
Serial.println(HELP_LED_CMD);
Serial.println(HELP_GPS_DATA_CMD);
Serial.println(HELP_GPS_CMD);
Serial.println(HELP_NMEA_CMD);

// WiFi sniff/scan
Serial.println(HELP_EVIL_PORTAL_CMD);
Expand Down Expand Up @@ -249,10 +252,10 @@ void CommandLine::runCommand(String input) {
// Bluetooth sniff/scan
#ifdef HAS_BT
Serial.println(HELP_BT_SNIFF_CMD);
Serial.println(HELP_BT_SOUR_APPLE_CMD);
Serial.println(HELP_BT_SWIFTPAIR_SPAM_CMD);
Serial.println(HELP_BT_SAMSUNG_SPAM_CMD);
Serial.println(HELP_BT_SPAM_ALL_CMD);
Serial.println(HELP_BT_SPAM_CMD);
//Serial.println(HELP_BT_SWIFTPAIR_SPAM_CMD);
//Serial.println(HELP_BT_SAMSUNG_SPAM_CMD);
//Serial.println(HELP_BT_SPAM_ALL_CMD);
#ifdef HAS_GPS
Serial.println(HELP_BT_WARDRIVE_CMD);
#endif
Expand All @@ -274,9 +277,20 @@ void CommandLine::runCommand(String input) {
// return;
//}

uint8_t old_scan_mode=wifi_scan_obj.currentScanMode;

wifi_scan_obj.StartScan(WIFI_SCAN_OFF);

Serial.println("Stopping WiFi tran/recv");
//#ifdef HAS_GPS
// gps_obj.disable_queue();
//#endif

if(old_scan_mode == WIFI_SCAN_GPS_NMEA)
Serial.println("END OF NMEA STREAM");
else if(old_scan_mode == WIFI_SCAN_GPS_DATA)
Serial.println("Stopping GPS data updates");
else
Serial.println("Stopping WiFi tran/recv");

// If we don't do this, the text and button coordinates will be off
#ifdef HAS_SCREEN
Expand All @@ -300,6 +314,7 @@ void CommandLine::runCommand(String input) {
#ifdef HAS_GPS
if (gps_obj.getGpsModuleStatus()) {
int get_arg = this->argSearch(&cmd_args, "-g");
int nmea_arg = this->argSearch(&cmd_args, "-n");

if (get_arg != -1) {
String gps_info = cmd_args.get(get_arg + 1);
Expand All @@ -314,11 +329,49 @@ void CommandLine::runCommand(String input) {
Serial.println("Lon: " + gps_obj.getLon());
else if (gps_info == "alt")
Serial.println("Alt: " + (String)gps_obj.getAlt());
else if (gps_info == "accuracy")
Serial.println("Accuracy: " + (String)gps_obj.getAccuracy());
else if (gps_info == "date")
Serial.println("Date/Time: " + gps_obj.getDatetime());
else if (gps_info == "nmea"){
int notimp_arg = this->argSearch(&cmd_args, "-p");
int recd_arg = this->argSearch(&cmd_args, "-r");
if(notimp_arg == -1 && recd_arg == -1){
gps_obj.sendSentence(Serial, gps_obj.generateGXgga().c_str());
gps_obj.sendSentence(Serial, gps_obj.generateGXrmc().c_str());
}
else if(notimp_arg == -1)
Serial.println(gps_obj.getNmea());
else
Serial.println(gps_obj.getNmeaNotimp());
}
else
Serial.println("You did not provide a valid argument");
}
else if(nmea_arg != -1){
String nmea_type = cmd_args.get(nmea_arg + 1);

if (nmea_type == "all" || nmea_type == "gps" || nmea_type == "glonass" || nmea_type== "galileo")
gps_obj.setType(nmea_type);
else
Serial.println("You did not provide a valid argument");
}
else if(cmd_args.size()>1)
Serial.println("You did not provide a valid flag");
else
Serial.println("You did not provide an argument");
}
#endif
}
else if (cmd_args.get(0) == NMEA_CMD) {
#ifdef HAS_GPS
if (gps_obj.getGpsModuleStatus()) {
#ifdef HAS_SCREEN
menu_function_obj.changeMenu(&menu_function_obj.gpsInfoMenu);
#endif
gps_obj.enable_queue();
wifi_scan_obj.currentScanMode = WIFI_SCAN_GPS_NMEA;
wifi_scan_obj.StartScan(WIFI_SCAN_GPS_NMEA, TFT_CYAN);
}
#endif
}
Expand Down Expand Up @@ -791,7 +844,77 @@ void CommandLine::runCommand(String input) {
Serial.println("Bluetooth not supported");
#endif
}
else if (cmd_args.get(0) == BT_SOUR_APPLE_CMD) {
else if (cmd_args.get(0) == BT_SPAM_CMD) {
int bt_type_sw = this->argSearch(&cmd_args, "-t");
if (bt_type_sw != -1) {
String bt_type = cmd_args.get(bt_type_sw + 1);

if (bt_type == "apple") {
#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 (bt_type == "windows") {
#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 (bt_type == "samsung") {
#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 (bt_type == "google") {
#ifdef HAS_BT
Serial.println("Starting Google Spam attack. Stop with " + (String)STOPSCAN_CMD);
#ifdef HAS_SCREEN
display_obj.clearScreen();
menu_function_obj.drawStatusBar();
#endif
wifi_scan_obj.StartScan(BT_ATTACK_GOOGLE_SPAM, TFT_CYAN);
#else
Serial.println("Bluetooth not supported");
#endif
}
else if (bt_type == "all") {
#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
}
else {
Serial.println("You did not specify a correct spam type");
}
}
}
/*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
Expand Down Expand Up @@ -838,7 +961,7 @@ void CommandLine::runCommand(String input) {
#else
Serial.println("Bluetooth not supported");
#endif
}
}*/
// Wardrive
else if (cmd_args.get(0) == BT_WARDRIVE_CMD) {
#ifdef HAS_BT
Expand Down
24 changes: 15 additions & 9 deletions esp32_marauder/CommandLine.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#pragma once

#ifndef CommandLine_h
#define CommandLine_h

Expand Down Expand Up @@ -47,6 +49,7 @@ const char PROGMEM LS_CMD[] = "ls";
const char PROGMEM LED_CMD[] = "led";
const char PROGMEM GPS_DATA_CMD[] = "gpsdata";
const char PROGMEM GPS_CMD[] = "gps";
const char PROGMEM NMEA_CMD[] = "nmea";

// WiFi sniff/scan
const char PROGMEM EVIL_PORTAL_CMD[] = "evilportal";
Expand Down Expand Up @@ -76,11 +79,12 @@ const char PROGMEM SEL_CMD[] = "select";
const char PROGMEM SSID_CMD[] = "ssid";

// Bluetooth sniff/scan
const char PROGMEM BT_SPAM_CMD[] = "blespam";
const char PROGMEM BT_SNIFF_CMD[] = "sniffbt";
const char PROGMEM BT_SOUR_APPLE_CMD[] = "sourapple";
const char PROGMEM BT_SWIFTPAIR_SPAM_CMD[] = "swiftpair";
const char PROGMEM BT_SAMSUNG_SPAM_CMD[] = "samsungblespam";
const char PROGMEM BT_SPAM_ALL_CMD[] = "btspamall";
//const char PROGMEM BT_SOUR_APPLE_CMD[] = "sourapple";
//const char PROGMEM BT_SWIFTPAIR_SPAM_CMD[] = "swiftpair";
//const char PROGMEM BT_SAMSUNG_SPAM_CMD[] = "samsungblespam";
//onst char PROGMEM BT_SPAM_ALL_CMD[] = "btspamall";
const char PROGMEM BT_WARDRIVE_CMD[] = "btwardrive";
const char PROGMEM BT_SKIM_CMD[] = "sniffskim";

Expand All @@ -96,7 +100,8 @@ const char PROGMEM HELP_SETTINGS_CMD[] = "settings [-s <setting> enable/disable>
const char PROGMEM HELP_LS_CMD[] = "ls <directory>";
const char PROGMEM HELP_LED_CMD[] = "led -s <hex color>/-p <rainbow>";
const char PROGMEM HELP_GPS_DATA_CMD[] = "gpsdata";
const char PROGMEM HELP_GPS_CMD[] = "gps [-g] <fix/sat/lon/lat/alt/date>";
const char PROGMEM HELP_GPS_CMD[] = "gps [-g] <fix/sat/lon/lat/alt/date/accuracy/nmea> [-n] <all/gps/glonass/galileo>";
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>]";
Expand Down Expand Up @@ -126,10 +131,11 @@ const char PROGMEM HELP_SSID_CMD_B[] = "ssid -r <index>";

// Bluetooth sniff/scan
const char PROGMEM HELP_BT_SNIFF_CMD[] = "sniffbt";
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";
const char PROGMEM HELP_BT_SPAM_ALL_CMD[] = "btspamall";
const char PROGMEM HELP_BT_SPAM_CMD[] = "blespam -t <apple/google/samsung/windows/all>";
//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";
//onst char PROGMEM HELP_BT_SPAM_ALL_CMD[] = "btspamall";
const char PROGMEM HELP_BT_WARDRIVE_CMD[] = "btwardrive [-c]";
const char PROGMEM HELP_BT_SKIM_CMD[] = "sniffskim";
const char PROGMEM HELP_FOOT[] = "==================================";
Expand Down
2 changes: 2 additions & 0 deletions esp32_marauder/Display.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#pragma once

#ifndef Display_h
#define Display_h

Expand Down
2 changes: 2 additions & 0 deletions esp32_marauder/EvilPortal.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#pragma once

#ifndef EvilPortal_h
#define EvilPortal_h

Expand Down
Loading

0 comments on commit 9a36164

Please sign in to comment.