Skip to content

Commit

Permalink
Add sigmon to menu
Browse files Browse the repository at this point in the history
  • Loading branch information
justcallmekoko committed May 22, 2023
1 parent 0a90e6a commit 4d269b3
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 55 deletions.
4 changes: 4 additions & 0 deletions esp32_marauder/CommandLine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,10 @@ void CommandLine::runCommand(String input) {
// Signal strength scan
if (cmd_args.get(0) == SIGSTREN_CMD) {
Serial.println("Starting Signal Strength Scan. Stop with " + (String)STOPSCAN_CMD);
#ifdef HAS_SCREEN
display_obj.clearScreen();
menu_function_obj.drawStatusBar();
#endif
wifi_scan_obj.StartScan(WIFI_SCAN_SIG_STREN, TFT_MAGENTA);
}
// AP Scan
Expand Down
4 changes: 2 additions & 2 deletions esp32_marauder/CommandLine.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const char PROGMEM HELP_CMD[] = "help";
const char PROGMEM SETTINGS_CMD[] = "settings";

// WiFi sniff/scan
const char PROGMEM SIGSTREN_CMD[] = "sigstren";
const char PROGMEM SIGSTREN_CMD[] = "sigmon";
const char PROGMEM SCANAP_CMD[] = "scanap";
const char PROGMEM SCANSTA_CMD[] = "scansta";
const char PROGMEM SNIFF_RAW_CMD[] = "sniffraw";
Expand Down Expand Up @@ -78,7 +78,7 @@ const char PROGMEM HELP_UPDATE_CMD_A[] = "update -s/-w";
const char PROGMEM HELP_SETTINGS_CMD[] = "settings [-s <setting> enable/disable>]/[-r]";

// WiFi sniff/scan
const char PROGMEM HELP_SIGSTREN_CMD[] = "sigstren";
const char PROGMEM HELP_SIGSTREN_CMD[] = "sigmon";
const char PROGMEM HELP_SCANAP_CMD[] = "scanap";
const char PROGMEM HELP_SCANSTA_CMD[] = "scansta";
const char PROGMEM HELP_SNIFF_RAW_CMD[] = "sniffraw";
Expand Down
7 changes: 7 additions & 0 deletions esp32_marauder/MenuFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1650,6 +1650,13 @@ void MenuFunctions::RunSetup()
this->drawStatusBar();
wifi_scan_obj.StartScan(WIFI_SCAN_STATION, TFT_WHITE);
});
#ifdef HAS_ILI9341
addNodes(&wifiSnifferMenu, "Signal Monitor", TFT_CYAN, NULL, PACKET_MONITOR, [this]() {
display_obj.clearScreen();
this->drawStatusBar();
wifi_scan_obj.StartScan(WIFI_SCAN_SIG_STREN, TFT_CYAN);
});
#endif

// Build WiFi attack menu
wifiAttackMenu.parentMenu = &wifiMenu; // Main Menu is second menu parent
Expand Down
112 changes: 59 additions & 53 deletions esp32_marauder/WiFiScan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1235,7 +1235,8 @@ void WiFiScan::RunRawScan(uint8_t scan_mode, uint16_t color)
#ifdef WRITE_PACKETS_SERIAL
buffer_obj.open();
#else
sd_obj.openCapture("raw");
if (scan_mode != WIFI_SCAN_SIG_STREN)
sd_obj.openCapture("raw");
#endif

#ifdef MARAUDER_FLIPPER
Expand All @@ -1254,7 +1255,10 @@ void WiFiScan::RunRawScan(uint8_t scan_mode, uint16_t color)
display_obj.tft.setTextColor(TFT_WHITE, color);
#ifdef HAS_ILI9341
display_obj.tft.fillRect(0,16,240,16, color);
display_obj.tft.drawCentreString(text_table1[58],120,16,2);
if (scan_mode != WIFI_SCAN_SIG_STREN)
display_obj.tft.drawCentreString(text_table1[58],120,16,2);
else
display_obj.tft.drawCentreString("Signal Monitor", 120, 16, 2);
display_obj.touchToExit();
#endif
display_obj.tft.setTextColor(TFT_GREEN, TFT_BLACK);
Expand Down Expand Up @@ -2203,7 +2207,6 @@ void WiFiScan::rawSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type)
found = true;
}
if (found) {
//Serial.println("Received beacon from " + access_points->get(i).essid + ". Checking RSSI...");
targ_ap = access_points->get(i);
targ_index = i;
break;
Expand All @@ -2216,9 +2219,11 @@ void WiFiScan::rawSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type)
if ((targ_ap.rssi + 5 < snifferPacket->rx_ctrl.rssi) || (snifferPacket->rx_ctrl.rssi + 5 < targ_ap.rssi)) {
targ_ap.rssi = snifferPacket->rx_ctrl.rssi;
access_points->set(targ_index, targ_ap);
Serial.println((String)access_points->get(targ_index).essid + " RSSI: " + (String)access_points->get(targ_index).rssi);
return;
Serial.print((String)access_points->get(targ_index).essid + " RSSI: " + (String)access_points->get(targ_index).rssi);
display_string = (String)access_points->get(targ_index).essid + " RSSI: " + (String)access_points->get(targ_index).rssi;
}
else
return;
}

else {
Expand All @@ -2235,29 +2240,29 @@ void WiFiScan::rawSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type)

display_string.concat(" ");
display_string.concat(addr);
}

int temp_len = display_string.length();
int temp_len = display_string.length();

#ifdef HAS_SCREEN
for (int i = 0; i < 40 - temp_len; i++)
{
display_string.concat(" ");
}
#ifdef HAS_SCREEN
for (int i = 0; i < 40 - temp_len; i++)
{
display_string.concat(" ");
}

Serial.print(" ");
Serial.print(" ");

if (display_obj.display_buffer->size() == 0)
{
display_obj.loading = true;
display_obj.display_buffer->add(display_string);
display_obj.loading = false;
}
#endif
if (display_obj.display_buffer->size() == 0)
{
display_obj.loading = true;
display_obj.display_buffer->add(display_string);
display_obj.loading = false;
}
#endif

Serial.println();
Serial.println();

addPacket(snifferPacket, len);
}
addPacket(snifferPacket, len);
}

void WiFiScan::deauthSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type)
Expand Down Expand Up @@ -2953,6 +2958,7 @@ void WiFiScan::wifiSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type)

void WiFiScan::eapolSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type)
{
extern WiFiScan wifi_scan_obj;
bool send_deauth = settings_obj.loadSetting<bool>(text_table4[5]);

wifi_promiscuous_pkt_t *snifferPacket = (wifi_promiscuous_pkt_t*)buf;
Expand Down Expand Up @@ -2981,32 +2987,32 @@ void WiFiScan::eapolSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type)
if (snifferPacket->payload[0] == 0x80) {
// Build packet

uint8_t new_packet[26] = {
/*uint8_t new_packet[26] = {
0xc0, 0x00, 0x3a, 0x01,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xf0, 0xff, 0x02, 0x00
};
};*/

new_packet[10] = snifferPacket->payload[10];
new_packet[11] = snifferPacket->payload[11];
new_packet[12] = snifferPacket->payload[12];
new_packet[13] = snifferPacket->payload[13];
new_packet[14] = snifferPacket->payload[14];
new_packet[15] = snifferPacket->payload[15];
wifi_scan_obj.deauth_frame_default[10] = snifferPacket->payload[10];
wifi_scan_obj.deauth_frame_default[11] = snifferPacket->payload[11];
wifi_scan_obj.deauth_frame_default[12] = snifferPacket->payload[12];
wifi_scan_obj.deauth_frame_default[13] = snifferPacket->payload[13];
wifi_scan_obj.deauth_frame_default[14] = snifferPacket->payload[14];
wifi_scan_obj.deauth_frame_default[15] = snifferPacket->payload[15];

new_packet[16] = snifferPacket->payload[10];
new_packet[17] = snifferPacket->payload[11];
new_packet[18] = snifferPacket->payload[12];
new_packet[19] = snifferPacket->payload[13];
new_packet[20] = snifferPacket->payload[14];
new_packet[21] = snifferPacket->payload[15];
wifi_scan_obj.deauth_frame_default[16] = snifferPacket->payload[10];
wifi_scan_obj.deauth_frame_default[17] = snifferPacket->payload[11];
wifi_scan_obj.deauth_frame_default[18] = snifferPacket->payload[12];
wifi_scan_obj.deauth_frame_default[19] = snifferPacket->payload[13];
wifi_scan_obj.deauth_frame_default[20] = snifferPacket->payload[14];
wifi_scan_obj.deauth_frame_default[21] = snifferPacket->payload[15];

// Send packet
//esp_wifi_80211_tx(WIFI_IF_AP, new_packet, sizeof(new_packet), false);
//esp_wifi_80211_tx(WIFI_IF_AP, new_packet, sizeof(new_packet), false);
esp_wifi_80211_tx(WIFI_IF_AP, new_packet, sizeof(new_packet), false);
esp_wifi_80211_tx(WIFI_IF_AP, wifi_scan_obj.deauth_frame_default, sizeof(wifi_scan_obj.deauth_frame_default), false);
delay(1);
}

Expand Down Expand Up @@ -3119,32 +3125,32 @@ void WiFiScan::activeEapolSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t
//Serial.println("Recieved beacon frame");


uint8_t new_packet[26] = {
/*uint8_t new_packet[26] = {
0xc0, 0x00, 0x3a, 0x01,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xf0, 0xff, 0x02, 0x00
};
};*/

new_packet[10] = snifferPacket->payload[10];
new_packet[11] = snifferPacket->payload[11];
new_packet[12] = snifferPacket->payload[12];
new_packet[13] = snifferPacket->payload[13];
new_packet[14] = snifferPacket->payload[14];
new_packet[15] = snifferPacket->payload[15];

new_packet[16] = snifferPacket->payload[10];
new_packet[17] = snifferPacket->payload[11];
new_packet[18] = snifferPacket->payload[12];
new_packet[19] = snifferPacket->payload[13];
new_packet[20] = snifferPacket->payload[14];
new_packet[21] = snifferPacket->payload[15];
wifi_scan_obj.deauth_frame_default[10] = snifferPacket->payload[10];
wifi_scan_obj.deauth_frame_default[11] = snifferPacket->payload[11];
wifi_scan_obj.deauth_frame_default[12] = snifferPacket->payload[12];
wifi_scan_obj.deauth_frame_default[13] = snifferPacket->payload[13];
wifi_scan_obj.deauth_frame_default[14] = snifferPacket->payload[14];
wifi_scan_obj.deauth_frame_default[15] = snifferPacket->payload[15];

wifi_scan_obj.deauth_frame_default[16] = snifferPacket->payload[10];
wifi_scan_obj.deauth_frame_default[17] = snifferPacket->payload[11];
wifi_scan_obj.deauth_frame_default[18] = snifferPacket->payload[12];
wifi_scan_obj.deauth_frame_default[19] = snifferPacket->payload[13];
wifi_scan_obj.deauth_frame_default[20] = snifferPacket->payload[14];
wifi_scan_obj.deauth_frame_default[21] = snifferPacket->payload[15];

// Send packet
//esp_wifi_80211_tx(WIFI_IF_AP, new_packet, sizeof(new_packet), false);
//esp_wifi_80211_tx(WIFI_IF_AP, new_packet, sizeof(new_packet), false);
esp_wifi_80211_tx(WIFI_IF_AP, new_packet, sizeof(new_packet), false);
esp_wifi_80211_tx(WIFI_IF_AP, wifi_scan_obj.deauth_frame_default, sizeof(wifi_scan_obj.deauth_frame_default), false);
delay(1);
}

Expand Down

0 comments on commit 4d269b3

Please sign in to comment.