mirror of
https://github.com/justcallmekoko/ESP32Marauder.git
synced 2026-07-28 14:47:16 -07:00
Merge pull request #1160 from justcallmekoko/develop
Remove station scan and move wardriving
This commit is contained in:
@@ -245,7 +245,7 @@ void CommandLine::runCommand(String input) {
|
||||
Serial.println(HELP_SIGSTREN_CMD);
|
||||
Serial.println(HELP_SCAN_ALL_CMD);
|
||||
Serial.println(HELP_SCANAP_CMD);
|
||||
Serial.println(HELP_SCANSTA_CMD);
|
||||
//Serial.println(HELP_SCANSTA_CMD);
|
||||
Serial.println(HELP_SNIFF_RAW_CMD);
|
||||
Serial.println(HELP_SNIFF_BEACON_CMD);
|
||||
Serial.println(HELP_SNIFF_PROBE_CMD);
|
||||
@@ -572,7 +572,7 @@ void CommandLine::runCommand(String input) {
|
||||
else if (cmd_args.get(0) == WARDRIVE_CMD) {
|
||||
#ifdef HAS_GPS
|
||||
if (gps_obj.getGpsModuleStatus()) {
|
||||
int sta_sw = this->argSearch(&cmd_args, "-s");
|
||||
//int sta_sw = this->argSearch(&cmd_args, "-s");
|
||||
int flk_sw = this->argSearch(&cmd_args, "-f");
|
||||
|
||||
if (flk_sw != -1) {
|
||||
@@ -584,15 +584,9 @@ void CommandLine::runCommand(String input) {
|
||||
#endif
|
||||
wifi_scan_obj.StartScan(BT_SCAN_FLOCK_WARDRIVE, TFT_GREEN);*/
|
||||
}
|
||||
else if (sta_sw != -1) {
|
||||
/*else if (sta_sw != -1) {
|
||||
this->startScanFromCLI(WIFI_SCAN_STATION_WAR_DRIVE, TFT_GREEN, "Station Wardrive");
|
||||
/*Serial.println(STOPSCAN_CMD);
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.clearScreen();
|
||||
menu_function_obj.drawStatusBar();
|
||||
#endif
|
||||
wifi_scan_obj.StartScan(WIFI_SCAN_STATION_WAR_DRIVE, TFT_GREEN);*/
|
||||
}
|
||||
}*/
|
||||
else {
|
||||
this->startScanFromCLI(WIFI_SCAN_WAR_DRIVE, TFT_GREEN, "Wardrive");
|
||||
/*Serial.println(STOPSCAN_CMD);
|
||||
@@ -730,19 +724,13 @@ void CommandLine::runCommand(String input) {
|
||||
wifi_scan_obj.StartScan(WIFI_SCAN_RAW_CAPTURE, TFT_WHITE);*/
|
||||
}
|
||||
// Scan stations
|
||||
else if (cmd_args.get(0) == SCANSTA_CMD) {
|
||||
/*else if (cmd_args.get(0) == SCANSTA_CMD) {
|
||||
if(access_points->size() < 1)
|
||||
Serial.print(F("The AP list is empty. Scan APs first with "));
|
||||
Serial.println(SCANAP_CMD);
|
||||
|
||||
this->startScanFromCLI(WIFI_SCAN_STATION, TFT_ORANGE, "Station scan");
|
||||
/*Serial.println(STOPSCAN_CMD);
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.clearScreen();
|
||||
menu_function_obj.drawStatusBar();
|
||||
#endif
|
||||
wifi_scan_obj.StartScan(WIFI_SCAN_STATION, TFT_ORANGE);*/
|
||||
}
|
||||
}*/
|
||||
// Beacon sniff
|
||||
else if (cmd_args.get(0) == SNIFF_BEACON_CMD) {
|
||||
this->startScanFromCLI(WIFI_SCAN_AP, TFT_MAGENTA, "Beacon sniff");
|
||||
|
||||
@@ -67,7 +67,7 @@ const char PROGMEM PACKET_COUNT_CMD[] = "packetcount";
|
||||
const char PROGMEM SIGSTREN_CMD[] = "sigmon";
|
||||
const char PROGMEM SCAN_ALL_CMD[] = "scanall";
|
||||
const char PROGMEM SCANAP_CMD[] = "scanap";
|
||||
const char PROGMEM SCANSTA_CMD[] = "scansta";
|
||||
//const char PROGMEM SCANSTA_CMD[] = "scansta";
|
||||
const char PROGMEM SNIFF_RAW_CMD[] = "sniffraw";
|
||||
const char PROGMEM SNIFF_BEACON_CMD[] = "sniffbeacon";
|
||||
const char PROGMEM SNIFF_PROBE_CMD[] = "sniffprobe";
|
||||
@@ -142,7 +142,7 @@ const char PROGMEM HELP_PACKET_COUNT_CMD[] = "packetcount";
|
||||
const char PROGMEM HELP_SIGSTREN_CMD[] = "sigmon";
|
||||
const char PROGMEM HELP_SCAN_ALL_CMD[] = "scanall";
|
||||
const char PROGMEM HELP_SCANAP_CMD[] = "scanap";
|
||||
const char PROGMEM HELP_SCANSTA_CMD[] = "scansta";
|
||||
//const char PROGMEM HELP_SCANSTA_CMD[] = "scansta";
|
||||
const char PROGMEM HELP_SNIFF_RAW_CMD[] = "sniffraw";
|
||||
const char PROGMEM HELP_SNIFF_BEACON_CMD[] = "sniffbeacon";
|
||||
const char PROGMEM HELP_SNIFF_PROBE_CMD[] = "sniffprobe";
|
||||
@@ -152,7 +152,7 @@ const char PROGMEM HELP_SNIFF_MULTISSID_CMD[] = "sniffmultissid";
|
||||
const char PROGMEM HELP_SNIFF_DEAUTH_CMD[] = "sniffdeauth";
|
||||
const char PROGMEM HELP_SNIFF_PMKID_CMD[] = "sniffpmkid [-c <channel>][-d][-l]";
|
||||
const char PROGMEM HELP_STOPSCAN_CMD[] = "stopscan [-f]";
|
||||
const char PROGMEM HELP_WARDRIVE_CMD[] = "wardrive [-s/-f]";
|
||||
const char PROGMEM HELP_WARDRIVE_CMD[] = "wardrive [-f]";
|
||||
const char PROGMEM HELP_PING_CMD[] = "pingscan";
|
||||
const char PROGMEM HELP_PORT_SCAN_CMD[] = "portscan [-a -t <ip index>]/[-s <ssh/telnet/dns/http/smtp/https/rdp>]";
|
||||
const char PROGMEM HELP_ARP_SCAN_CMD[] = "arpscan [-f]";
|
||||
|
||||
@@ -1470,9 +1470,9 @@ void MenuFunctions::RunSetup()
|
||||
wifiSnifferMenu.list = new LinkedList<MenuNode>();
|
||||
wifiScannerMenu.list = new LinkedList<MenuNode>();
|
||||
wifiAttackMenu.list = new LinkedList<MenuNode>();
|
||||
#ifdef HAS_GPS
|
||||
/*#ifdef HAS_GPS
|
||||
wardrivingMenu.list = new LinkedList<MenuNode>();
|
||||
#endif
|
||||
#endif*/
|
||||
wifiGeneralMenu.list = new LinkedList<MenuNode>();
|
||||
wifiAPMenu.list = new LinkedList<MenuNode>();
|
||||
wifiIPMenu.list = new LinkedList<MenuNode>();
|
||||
@@ -1547,7 +1547,7 @@ void MenuFunctions::RunSetup()
|
||||
#ifdef HAS_GPS
|
||||
gpsMenu.name = "GPS";
|
||||
gpsInfoMenu.name = "GPS Data";
|
||||
wardrivingMenu.name = "Wardriving";
|
||||
//wardrivingMenu.name = "Wardriving";
|
||||
#endif
|
||||
htmlMenu.name = "EP HTML List";
|
||||
miniKbMenu.name = "Mini Keyboard";
|
||||
@@ -1593,11 +1593,11 @@ void MenuFunctions::RunSetup()
|
||||
this->addNodes(&wifiMenu, "Scanners", TFTORANGE, NULL, SCANNERS, [this]() {
|
||||
this->changeMenu(&wifiScannerMenu, true);
|
||||
});
|
||||
#ifdef HAS_GPS
|
||||
/*#ifdef HAS_GPS
|
||||
this->addNodes(&wifiMenu, "Wardriving", TFTGREEN, NULL, BEACON_SNIFF, [this]() {
|
||||
this->changeMenu(&wardrivingMenu, true);
|
||||
});
|
||||
#endif
|
||||
#endif*/
|
||||
this->addNodes(&wifiMenu, text_table1[32], TFTRED, NULL, ATTACKS, [this]() {
|
||||
this->changeMenu(&wifiAttackMenu, true);
|
||||
});
|
||||
@@ -1771,11 +1771,11 @@ void MenuFunctions::RunSetup()
|
||||
this->drawStatusBar();
|
||||
wifi_scan_obj.StartScan(WIFI_SCAN_AP_STA, 0x97e0);
|
||||
});
|
||||
this->addNodes(&wifiSnifferMenu, text_table1[59], TFTORANGE, NULL, PACKET_MONITOR, [this]() {
|
||||
/*this->addNodes(&wifiSnifferMenu, text_table1[59], TFTORANGE, NULL, PACKET_MONITOR, [this]() {
|
||||
display_obj.clearScreen();
|
||||
this->drawStatusBar();
|
||||
wifi_scan_obj.StartScan(WIFI_SCAN_STATION, TFT_WHITE);
|
||||
});
|
||||
});*/
|
||||
this->addNodes(&wifiSnifferMenu, "Signal Monitor", TFTCYAN, NULL, PACKET_MONITOR, [this]() {
|
||||
display_obj.clearScreen();
|
||||
this->drawStatusBar();
|
||||
@@ -1794,19 +1794,19 @@ void MenuFunctions::RunSetup()
|
||||
|
||||
// Build Wardriving menu
|
||||
#ifdef HAS_GPS
|
||||
wardrivingMenu.parentMenu = &wifiMenu; // Main Menu is second menu parent
|
||||
/*wardrivingMenu.parentMenu = &wifiMenu; // Main Menu is second menu parent
|
||||
this->addNodes(&wardrivingMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
|
||||
this->changeMenu(wardrivingMenu.parentMenu, true);
|
||||
});
|
||||
});*/
|
||||
if (gps_obj.getGpsModuleStatus()) {
|
||||
this->addNodes(&wardrivingMenu, "Wardrive", TFTGREEN, NULL, BEACON_SNIFF, [this]() {
|
||||
this->addNodes(&wifiSnifferMenu, "Wardrive", TFTGREEN, NULL, BEACON_SNIFF, [this]() {
|
||||
display_obj.clearScreen();
|
||||
this->drawStatusBar();
|
||||
wifi_scan_obj.StartScan(WIFI_SCAN_WAR_DRIVE, TFT_GREEN);
|
||||
});
|
||||
}
|
||||
#endif
|
||||
#ifdef HAS_GPS
|
||||
/*#ifdef HAS_GPS
|
||||
if (gps_obj.getGpsModuleStatus()) {
|
||||
this->addNodes(&wardrivingMenu, "Station Wardrive", TFTORANGE, NULL, PROBE_SNIFF, [this]() {
|
||||
display_obj.clearScreen();
|
||||
@@ -1814,7 +1814,7 @@ void MenuFunctions::RunSetup()
|
||||
wifi_scan_obj.StartScan(WIFI_SCAN_STATION_WAR_DRIVE, TFT_ORANGE);
|
||||
});
|
||||
}
|
||||
#endif
|
||||
#endif*/
|
||||
|
||||
// Build WiFi attack menu
|
||||
wifiAttackMenu.parentMenu = &wifiMenu; // Main Menu is second menu parent
|
||||
|
||||
@@ -163,9 +163,9 @@ class MenuFunctions
|
||||
Menu wifiSnifferMenu;
|
||||
Menu wifiScannerMenu;
|
||||
Menu wifiAttackMenu;
|
||||
#ifdef HAS_GPS
|
||||
/*#ifdef HAS_GPS
|
||||
Menu wardrivingMenu;
|
||||
#endif
|
||||
#endif*/
|
||||
Menu wifiGeneralMenu;
|
||||
Menu wifiAPMenu;
|
||||
Menu wifiIPMenu;
|
||||
|
||||
@@ -2298,8 +2298,8 @@ void WiFiScan::StartScan(uint8_t scan_mode, uint16_t color) {
|
||||
RunRawScan(scan_mode, color);
|
||||
else if (scan_mode == WIFI_SCAN_RAW_CAPTURE)
|
||||
RunRawScan(scan_mode, color);
|
||||
else if (scan_mode == WIFI_SCAN_STATION)
|
||||
RunStationScan(scan_mode, color);
|
||||
//else if (scan_mode == WIFI_SCAN_STATION)
|
||||
// RunStationScan(scan_mode, color);
|
||||
else if (scan_mode == WIFI_SCAN_TARGET_AP)
|
||||
RunAPScan(scan_mode, color);
|
||||
else if (scan_mode == WIFI_SCAN_TARGET_AP_FULL)
|
||||
@@ -5137,19 +5137,10 @@ void WiFiScan::startWardriverWiFi() {
|
||||
WiFi.disconnect();
|
||||
}
|
||||
|
||||
void WiFiScan::RunStationScan(uint8_t scan_mode, uint16_t color) {
|
||||
/*void WiFiScan::RunStationScan(uint8_t scan_mode, uint16_t color) {
|
||||
startPcap(F("station"));
|
||||
|
||||
this->setLEDMode(MODE_SNIFF);
|
||||
/*#ifdef HAS_FLIPPER_LED
|
||||
flipper_led.sniffLED();
|
||||
#elif defined(XIAO_ESP32_S3)
|
||||
xiao_led.sniffLED();
|
||||
#elif defined(MARAUDER_M5STICKC)
|
||||
stickc_led.sniffLED();
|
||||
#else
|
||||
led_obj.setMode(MODE_SNIFF);
|
||||
#endif*/
|
||||
|
||||
#ifdef HAS_SCREEN
|
||||
this->setupScanDisplayArea(TFT_BLACK, color);
|
||||
@@ -5182,18 +5173,10 @@ void WiFiScan::RunStationScan(uint8_t scan_mode, uint16_t color) {
|
||||
esp_event_loop_create_default();
|
||||
#endif
|
||||
this->setWiFiMode(WIFI_MODE_NULL, stationSnifferCallback);
|
||||
/*esp_wifi_set_storage(WIFI_STORAGE_RAM);
|
||||
esp_wifi_set_mode(WIFI_MODE_NULL);
|
||||
esp_wifi_start();
|
||||
this->setMac();
|
||||
esp_wifi_set_promiscuous(true);
|
||||
esp_wifi_set_promiscuous_filter(&filt);
|
||||
esp_wifi_set_promiscuous_rx_cb(&stationSnifferCallback);*/
|
||||
this->changeChannel(this->set_channel);
|
||||
//esp_wifi_set_channel(set_channel, WIFI_SECOND_CHAN_NONE);
|
||||
this->wifi_initialized = true;
|
||||
initTime = millis();
|
||||
}
|
||||
}*/
|
||||
|
||||
void WiFiScan::RunRawScan(uint8_t scan_mode, uint16_t color) {
|
||||
if (scan_mode != WIFI_SCAN_SIG_STREN)
|
||||
@@ -7799,7 +7782,7 @@ void WiFiScan::beaconSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type
|
||||
|
||||
buffer_obj.append(snifferPacket, len);
|
||||
}
|
||||
else if (wifi_scan_obj.currentScanMode == WIFI_SCAN_STATION_WAR_DRIVE) {
|
||||
/*else if (wifi_scan_obj.currentScanMode == WIFI_SCAN_STATION_WAR_DRIVE) {
|
||||
#ifdef HAS_GPS
|
||||
if (gps_obj.getGpsModuleStatus()) {
|
||||
bool do_save = false;
|
||||
@@ -7814,7 +7797,6 @@ void WiFiScan::beaconSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type
|
||||
Serial.print(F(" Ch: "));
|
||||
Serial.print((String)snifferPacket->rx_ctrl.channel + " ");
|
||||
|
||||
//Serial.print(F(" BSSID: "));
|
||||
Serial.print(addr);
|
||||
display_string.concat(addr);
|
||||
|
||||
@@ -7842,7 +7824,6 @@ void WiFiScan::beaconSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type
|
||||
|
||||
Serial.println();
|
||||
|
||||
//wifi_scan_obj.save_mac(reinterpret_cast<unsigned char*>(addr));
|
||||
|
||||
if (do_save) {
|
||||
String wardrive_line = (String)addr + "," + (String)addr + ",," + gps_obj.getDatetime() + "," + (String)snifferPacket->rx_ctrl.channel + "," + (String)snifferPacket->rx_ctrl.rssi + "," + gps_obj.getLat() + "," + gps_obj.getLon() + "," + gps_obj.getAlt() + "," + gps_obj.getAccuracy() + ",WIFI";
|
||||
@@ -7851,7 +7832,7 @@ void WiFiScan::beaconSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8169,7 +8150,7 @@ void WiFiScan::beaconSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type
|
||||
}
|
||||
}
|
||||
|
||||
void WiFiScan::stationSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type) {
|
||||
/*void WiFiScan::stationSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type) {
|
||||
extern WiFiScan wifi_scan_obj;
|
||||
wifi_promiscuous_pkt_t *snifferPacket = (wifi_promiscuous_pkt_t*)buf;
|
||||
WifiMgmtHdr *frameControl = (WifiMgmtHdr*)snifferPacket->payload;
|
||||
@@ -8183,12 +8164,6 @@ void WiFiScan::stationSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t typ
|
||||
|
||||
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";
|
||||
@@ -8235,10 +8210,6 @@ void WiFiScan::stationSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t typ
|
||||
else
|
||||
frame_offset = 10;
|
||||
}
|
||||
/* Stuff to care about now
|
||||
* ap_is_src
|
||||
* ap_index
|
||||
*/
|
||||
|
||||
|
||||
// Check if we already have this station
|
||||
@@ -8247,10 +8218,8 @@ void WiFiScan::stationSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t typ
|
||||
mac_match = true;
|
||||
|
||||
for (int x = 0; x < 6; x++) {
|
||||
//Serial.println((String)snifferPacket->payload[x + 10] + " | " + (String)access_points->get(i).bssid[x]);
|
||||
if (snifferPacket->payload[x + frame_offset] != stations->get(i).mac[x]) {
|
||||
mac_match = false;
|
||||
//Serial.println("MACs do not match");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -8305,7 +8274,6 @@ void WiFiScan::stationSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t typ
|
||||
//display_string.concat(replaceOUIWithManufacturer(sta_addr));
|
||||
display_string.concat(sta_addr);
|
||||
|
||||
//display_string.concat(sta_addr);
|
||||
display_string.concat(" -> ");
|
||||
display_string.concat(access_points->get(ap_index).essid);
|
||||
|
||||
@@ -8322,8 +8290,6 @@ void WiFiScan::stationSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t typ
|
||||
display_obj.display_buffer->add(display_string);
|
||||
#endif
|
||||
|
||||
// Add station index to AP in list
|
||||
//access_points->get(ap_index).stations->add(stations->size() - 1);
|
||||
|
||||
if (mem_check) {
|
||||
AccessPoint ap = access_points->get(ap_index);
|
||||
@@ -8333,7 +8299,7 @@ void WiFiScan::stationSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t typ
|
||||
}
|
||||
|
||||
buffer_obj.append(snifferPacket, len);
|
||||
}
|
||||
}*/
|
||||
|
||||
/*void WiFiScan::rawSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type)
|
||||
{
|
||||
|
||||
@@ -627,7 +627,7 @@ class WiFiScan
|
||||
void RunMultiSSIDScan(uint8_t scan_mode, uint16_t color);
|
||||
void RunBeaconScan(uint8_t scan_mode, uint16_t color);
|
||||
void RunRawScan(uint8_t scan_mode, uint16_t color);
|
||||
void RunStationScan(uint8_t scan_mode, uint16_t color);
|
||||
//void RunStationScan(uint8_t scan_mode, uint16_t color);
|
||||
void RunDeauthScan(uint8_t scan_mode, uint16_t color);
|
||||
void RunEapolScan(uint8_t scan_mode, uint16_t color);
|
||||
void RunProbeScan(uint8_t scan_mode, uint16_t color);
|
||||
@@ -883,7 +883,7 @@ class WiFiScan
|
||||
static void getMAC(uint8_t* mac, const uint8_t* data, uint16_t offset);
|
||||
static void beaconSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type);
|
||||
//static void rawSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type);
|
||||
static void stationSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type);
|
||||
//static void stationSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type);
|
||||
//static void apSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type);
|
||||
static void apSnifferCallbackFull(void* buf, wifi_promiscuous_pkt_type_t type);
|
||||
//static void deauthSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type);
|
||||
|
||||
Reference in New Issue
Block a user