Преглед изворни кода

Add EAPOL sniff

There were a lot of stupid issues caused by the battery interface code. Got rid of it and I will not be adding any code to make it work. Fuck that shit.
Just Call Me Koko пре 5 година
родитељ
комит
3ce996d9e2

BIN
3Dfiles/ESP32_Marauder_Enclosure_body_3_antenna_sd.stl


+ 7 - 1
esp32_marauder/Assets.h

@@ -129,7 +129,13 @@ PROGMEM static const unsigned char menu_icons[][66] = {
     0xDD, 0xB6, 0x2D, 0xED, 0xB6, 0x2B, 0xED, 0xB6, 0x2B, 0x01, 0x00, 0x20, 
     0xED, 0xB6, 0x2B, 0xDD, 0xB6, 0x2D, 0xDB, 0xB6, 0x35, 0xDB, 0x96, 0x35, 
     0x07, 0x00, 0x38, 0x6F, 0x55, 0x3D, 0xDF, 0x94, 0x3E, 0x3F, 0x23, 0x3F, 
-    0xFF, 0xC0, 0x3F, 0xFF, 0xFF, 0x3F}
+    0xFF, 0xC0, 0x3F, 0xFF, 0xFF, 0x3F},
+    {0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0x3B, 0xFF, 0xFF, 0x39, // EAPOL: 21
+    0xFF, 0xFF, 0x3C, 0xFF, 0x7F, 0x3A, 0xFF, 0x3F, 0x37, 0xFF, 0x9F, 0x3E, 
+    0xFF, 0xCF, 0x3D, 0xFF, 0xE7, 0x3F, 0xFF, 0xF3, 0x3F, 0xCF, 0xF9, 0x3F, 
+    0xB7, 0xFC, 0x3F, 0x77, 0xFE, 0x3F, 0xF7, 0xFE, 0x3F, 0xEF, 0xFD, 0x3F, 
+    0xDF, 0xFB, 0x3F, 0xBF, 0xFB, 0x3F, 0x7F, 0xFC, 0x3F, 0xFF, 0xFF, 0x3F, 
+    0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0x3F}
     };
 
 

+ 7 - 0
esp32_marauder/Display.cpp

@@ -73,6 +73,13 @@ void Display::tftDrawGraphObjects(byte x_scale)
   tft.setCursor(3, 228); tft.print("0"); // "-" at bottom of y axis
 }
 
+void Display::tftDrawEapolColorKey()
+{
+  //Display color key
+  tft.setTextSize(1); tft.setTextColor(TFT_WHITE);
+  tft.fillRect(14, 0, 15, 8, TFT_CYAN); tft.setCursor(30, 0); tft.print(" - EAPOL"); 
+}
+
 void Display::tftDrawColorKey()
 {
   //Display color key

+ 2 - 1
esp32_marauder/Display.h

@@ -56,7 +56,7 @@ class Display
     TFT_eSPI tft = TFT_eSPI();
     TFT_eSprite img = TFT_eSprite(&tft);
     TFT_eSPI_Button key[BUTTON_ARRAY_LEN];
-    String version_number = "v0.5.4";
+    String version_number = "v0.6.0";
 
     bool printing = false;
     bool loading = false;
@@ -92,6 +92,7 @@ class Display
     int blank[19]; // We keep all the strings pixel lengths to optimise the speed of the top line blanking
 
     void tftDrawGraphObjects(byte x_scale);
+    void tftDrawEapolColorKey();
     void tftDrawColorKey();
     void tftDrawXScaleButtons(byte x_scale);
     void tftDrawYScaleButtons(byte y_scale);

+ 1 - 4
esp32_marauder/MenuFunctions.cpp

@@ -59,7 +59,6 @@ void MenuFunctions::main()
     // Stop the current scan
     if ((wifi_scan_obj.currentScanMode == WIFI_SCAN_PROBE) ||
     (wifi_scan_obj.currentScanMode == WIFI_SCAN_AP) ||
-    (wifi_scan_obj.currentScanMode == WIFI_SCAN_ST) ||
     (wifi_scan_obj.currentScanMode == WIFI_SCAN_ALL) || 
     (wifi_scan_obj.currentScanMode == WIFI_SCAN_DEAUTH) ||
     (wifi_scan_obj.currentScanMode == WIFI_ATTACK_BEACON_SPAM) ||
@@ -242,10 +241,8 @@ void MenuFunctions::RunSetup()
   wifiScannerMenu.parentMenu = &wifiMenu; // Main Menu is second menu parent
   addNodes(&wifiScannerMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this](){changeMenu(wifiScannerMenu.parentMenu);});
   addNodes(&wifiScannerMenu, "Packet Monitor", TFT_BLUE, NULL, PACKET_MONITOR, [this](){wifi_scan_obj.StartScan(WIFI_PACKET_MONITOR, TFT_BLUE);});
-<<<<<<< HEAD
   addNodes(&wifiScannerMenu, "EAPOL Scan", TFT_VIOLET, NULL, EAPOL, [this](){wifi_scan_obj.StartScan(WIFI_SCAN_EAPOL, TFT_VIOLET);});
-=======
->>>>>>> parent of 40e11b7... Capture EAPOL packets
+
 
   // Build WiFi attack menu
   wifiAttackMenu.parentMenu = &wifiMenu; // Main Menu is second menu parent

+ 1 - 0
esp32_marauder/MenuFunctions.h

@@ -46,6 +46,7 @@ extern Web web_obj;
 #define DEVICE_INFO 18
 #define SD_UPDATE 19
 #define WEB_UPDATE 20
+#define EAPOL 21
 
 struct Menu;
 

+ 386 - 19
esp32_marauder/WiFiScan.cpp

@@ -6,6 +6,7 @@
 int num_beacon = 0;
 int num_deauth = 0;
 int num_probe = 0;
+int num_eapol = 0;
 
 class bluetoothScanAllCallback: public BLEAdvertisedDeviceCallbacks {
     
@@ -127,6 +128,8 @@ void WiFiScan::StartScan(uint8_t scan_mode, uint16_t color)
     StopScan(scan_mode);
   else if (scan_mode == WIFI_SCAN_PROBE)
     RunProbeScan(scan_mode, color);
+  else if (scan_mode == WIFI_SCAN_EAPOL)
+    RunEapolScan(scan_mode, color);
   else if (scan_mode == WIFI_SCAN_AP)
     RunBeaconScan(scan_mode, color);
   else if (scan_mode == WIFI_SCAN_DEAUTH)
@@ -150,7 +153,7 @@ void WiFiScan::StopScan(uint8_t scan_mode)
 {
   if ((currentScanMode == WIFI_SCAN_PROBE) ||
   (currentScanMode == WIFI_SCAN_AP) ||
-  (currentScanMode == WIFI_SCAN_ST) ||
+  (currentScanMode == WIFI_SCAN_EAPOL) ||
   (currentScanMode == WIFI_SCAN_ALL) ||
   (currentScanMode == WIFI_SCAN_DEAUTH) ||
   (currentScanMode == WIFI_ATTACK_BEACON_SPAM) ||
@@ -160,7 +163,13 @@ void WiFiScan::StopScan(uint8_t scan_mode)
     Serial.println("Ahhh yes...promiscuity will end");
     esp_wifi_set_promiscuous(false);
     WiFi.mode(WIFI_OFF);
+
+    esp_wifi_set_mode(WIFI_MODE_NULL);
+    esp_wifi_stop();
+    esp_wifi_deinit();
   }
+
+  
   else if ((currentScanMode == BT_SCAN_ALL) ||
   (currentScanMode == BT_SCAN_SKIMMERS))
   {
@@ -275,24 +284,8 @@ void WiFiScan::RunInfo()
   }
   else {
     display_obj.tft.println("     SD Card: Not Connected");
-<<<<<<< HEAD
     display_obj.tft.println("SD Card Size: 0");
-  }
-  /*
-  battery_obj.battery_level = battery_obj.getBatteryLevel();
-  if (battery_obj.i2c_supported) {
-    display_obj.tft.println("  IP5306 I2C: supported");
-    display_obj.tft.println(" Battery Lvl: " + (String)battery_obj.battery_level + "%");
-  }
-  else
-    display_obj.tft.println("  IP5306 I2C: not supported");
-  */
-=======
-    display_obj.tft.print("SD Card Size: 0");
-  }
->>>>>>> parent of 40e11b7... Capture EAPOL packets
-
-  
+  }  
 }
 
 void WiFiScan::RunPacketMonitor(uint8_t scan_mode, uint16_t color)
@@ -340,6 +333,51 @@ void WiFiScan::RunPacketMonitor(uint8_t scan_mode, uint16_t color)
   uint32_t initTime = millis();
 }
 
+void WiFiScan::RunEapolScan(uint8_t scan_mode, uint16_t color)
+{
+  display_obj.tft.init();
+  display_obj.tft.setRotation(1);
+  display_obj.tft.fillScreen(TFT_BLACK);
+
+  sd_obj.openCapture("eapol");
+
+  #ifdef TFT_SHIELD
+    uint16_t calData[5] = { 391, 3491, 266, 3505, 7 }; // Landscape TFT Shield
+    Serial.println("Using TFT Shield");
+  #else if defined(TFT_DIY)
+    uint16_t calData[5] = { 213, 3469, 320, 3446, 1 }; // Landscape TFT DIY
+    Serial.println("Using TFT DIY");
+  #endif
+  display_obj.tft.setTouch(calData);
+
+  //display_obj.tft.setFreeFont(1);
+  display_obj.tft.setFreeFont(NULL);
+  display_obj.tft.setTextSize(1);
+  display_obj.tft.fillRect(127, 0, 193, 28, TFT_BLACK); // Buttons
+  display_obj.tft.fillRect(12, 0, 90, 32, TFT_BLACK); // color key
+
+  delay(10);
+
+  display_obj.tftDrawGraphObjects(x_scale); //draw graph objects
+  display_obj.tftDrawEapolColorKey();
+  //display_obj.tftDrawXScaleButtons(x_scale);
+  //display_obj.tftDrawYScaleButtons(y_scale);
+  display_obj.tftDrawChannelScaleButtons(set_channel);
+  display_obj.tftDrawExitScaleButtons();
+
+
+  wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
+  esp_wifi_init(&cfg);
+  esp_wifi_set_storage(WIFI_STORAGE_RAM);
+  esp_wifi_set_mode(WIFI_MODE_NULL);
+  esp_wifi_start();
+  esp_wifi_set_promiscuous(true);
+  esp_wifi_set_promiscuous_filter(&filt);
+  esp_wifi_set_promiscuous_rx_cb(&eapolSnifferCallback);
+  esp_wifi_set_channel(set_channel, WIFI_SECOND_CHAN_NONE);
+  initTime = millis();
+}
+
 void WiFiScan::RunRickRoll(uint8_t scan_mode, uint16_t color)
 {
   //Serial.println("Rick Roll...");
@@ -888,7 +926,333 @@ void WiFiScan::wifiSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type)
     }
 
     sd_obj.addPacket(snifferPacket->payload, len);
+
+    if (( (snifferPacket->payload[30] == 0x88 && snifferPacket->payload[31] == 0x8e)|| ( snifferPacket->payload[32] == 0x88 && snifferPacket->payload[33] == 0x8e) ))
+      Serial.println("Oh god mgmt EAPOL");
+  }
+
+  if (( (snifferPacket->payload[30] == 0x88 && snifferPacket->payload[31] == 0x8e)|| ( snifferPacket->payload[32] == 0x88 && snifferPacket->payload[33] == 0x8e) )){
+    Serial.println("EAPOL!!");
+    //sd_obj.addPacket(snifferPacket->payload, len);
+  }
+}
+
+void WiFiScan::eapolSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type)
+{
+  /*
+  wifi_promiscuous_pkt_t *snifferPacket = (wifi_promiscuous_pkt_t*)buf;
+  WifiMgmtHdr *frameControl = (WifiMgmtHdr*)snifferPacket->payload;
+  wifi_pkt_rx_ctrl_t ctrl = (wifi_pkt_rx_ctrl_t)snifferPacket->rx_ctrl;
+  int len = snifferPacket->rx_ctrl.sig_len;
+  String display_string = "";
+  if (type == WIFI_PKT_MGMT)
+  {
+    len -= 4;
+    int fctl = ntohs(frameControl->fctl);
+    const wifi_ieee80211_packet_t *ipkt = (wifi_ieee80211_packet_t *)snifferPacket->payload;
+    const WifiMgmtHdr *hdr = &ipkt->hdr;
+  }
+  if (( (snifferPacket->payload[30] == 0x88 && snifferPacket->payload[31] == 0x8e)|| ( snifferPacket->payload[32] == 0x88 && snifferPacket->payload[33] == 0x8e) )){
+    delay(random(0, 10));
+    Serial.print((String)random(0, 5) + "EAPOL: ");
+    char srcaddr[] = "00:00:00:00:00:00";
+    getMAC(srcaddr, snifferPacket->payload, 10);
+    Serial.print(srcaddr);
+    display_string.concat(srcaddr);
+    Serial.print(" -> ");
+    display_string.concat(" -> ");
+    char desaddr[] = "00:00:00:00:00:00";
+    getMAC(desaddr, snifferPacket->payload, 4);
+    Serial.print(desaddr);
+    display_string.concat(desaddr); 
+    // Print spaces because of the rotating lines of the hardware scroll.
+    // The same characters print from previous lines so I just overwrite them
+    // with spaces.
+    for (int i = 0; i < 19 - snifferPacket->payload[37]; i++)
+    {
+      display_string.concat(" ");
+    }
+    if (display_obj.display_buffer->size() == 0)
+    {
+      //while (display_obj.printing)
+      //  delay(1);
+      display_obj.loading = true;
+      display_obj.display_buffer->add(display_string);
+      display_obj.loading = false;
+    }
+    
+    Serial.println();    
+    sd_obj.addPacket(snifferPacket->payload, len);
+  }
+  */
+  wifi_promiscuous_pkt_t *snifferPacket = (wifi_promiscuous_pkt_t*)buf;
+  WifiMgmtHdr *frameControl = (WifiMgmtHdr*)snifferPacket->payload;
+  wifi_pkt_rx_ctrl_t ctrl = (wifi_pkt_rx_ctrl_t)snifferPacket->rx_ctrl;
+  int len = snifferPacket->rx_ctrl.sig_len;
+
+  if (type == WIFI_PKT_MGMT)
+  {
+    len -= 4;
+    int fctl = ntohs(frameControl->fctl);
+    const wifi_ieee80211_packet_t *ipkt = (wifi_ieee80211_packet_t *)snifferPacket->payload;
+    const WifiMgmtHdr *hdr = &ipkt->hdr;
+
+    // If we dont the buffer size is not 0, don't write or else we get CORRUPT_HEAP
+    /*
+    if (snifferPacket->payload[0] == 0x80)
+    {
+      num_beacon++;
+    }
+    else if ((snifferPacket->payload[0] == 0xA0 || snifferPacket->payload[0] == 0xC0 ))
+    {
+      num_deauth++;
+    }
+    else if (snifferPacket->payload[0] == 0x40)
+    {
+      num_probe++;
+    }
+    */
+
+    //sd_obj.addPacket(snifferPacket->payload, len);
+
+    if (( (snifferPacket->payload[30] == 0x88 && snifferPacket->payload[31] == 0x8e)|| ( snifferPacket->payload[32] == 0x88 && snifferPacket->payload[33] == 0x8e) ))
+      Serial.println("Oh god mgmt EAPOL");
+  }
+
+  if (( (snifferPacket->payload[30] == 0x88 && snifferPacket->payload[31] == 0x8e)|| ( snifferPacket->payload[32] == 0x88 && snifferPacket->payload[33] == 0x8e) )){
+    Serial.println("EAPOL!!");
+    sd_obj.addPacket(snifferPacket->payload, len);
+    num_eapol++;
+  }
+}
+
+void WiFiScan::eapolMonitorMain(uint32_t currentTime)
+{
+  //---------MAIN 'FOR' LOOP! THIS IS WHERE ALL THE ACTION HAPPENS! HAS TO BE FAST!!!!!---------\\
+  
+
+//  for (x_pos = (11 + x_scale); x_pos <= 320; x_pos += x_scale) //go along every point on the x axis and do something, start over when finished
+  for (x_pos = (11 + x_scale); x_pos <= 320; x_pos = x_pos)
+  {
+    currentTime = millis();
+    do_break = false;
+
+    y_pos_x = 0;
+    y_pos_y = 0;
+    y_pos_z = 0;
+    boolean pressed = false;
+
+    uint16_t t_x = 0, t_y = 0; // To store the touch coordinates
+
+    // Do the touch stuff
+    pressed = display_obj.tft.getTouch(&t_x, &t_y);
+
+    if (pressed) {
+      Serial.print("Got touch | X: ");
+      Serial.print(t_x);
+      Serial.print(" Y: ");
+      Serial.println(t_y);
+    }
+
+
+    // Check buttons for presses
+    for (uint8_t b = 0; b < BUTTON_ARRAY_LEN; b++)
+    {
+      if (pressed && display_obj.key[b].contains(t_x, t_y))
+      {
+        display_obj.key[b].press(true);
+      } else {
+        display_obj.key[b].press(false);
+      }
+    }
+
+    // Which buttons pressed
+    for (uint8_t b = 0; b < BUTTON_ARRAY_LEN; b++)
+    {
+      if (display_obj.key[b].justPressed())
+      {
+        Serial.println("Bro, key pressed");
+        //do_break = true;
+      }
+
+      if (display_obj.key[b].justReleased())
+      {
+        do_break = true;
+
+        /*
+        // X - button pressed
+        if (b == 0) {
+          if (x_scale > 1) {
+            x_scale--;
+            delay(70);
+            display_obj.tft.fillRect(127, 0, 193, 28, TFT_BLACK);
+            display_obj.tftDrawXScaleButtons(x_scale);
+            display_obj.tftDrawYScaleButtons(y_scale);
+            display_obj.tftDrawChannelScaleButtons(set_channel);
+            display_obj.tftDrawExitScaleButtons();
+            break;
+          }
+        }
+        // X + button pressed
+        else if (b == 1) {
+          if (x_scale < 6) {
+            x_scale++;
+            delay(70);
+            display_obj.tft.fillRect(127, 0, 193, 28, TFT_BLACK);
+            display_obj.tftDrawXScaleButtons(x_scale);
+            display_obj.tftDrawYScaleButtons(y_scale);
+            display_obj.tftDrawChannelScaleButtons(set_channel);
+            display_obj.tftDrawExitScaleButtons();
+            break;
+          }
+        }
+        // Y - button pressed
+        else if (b == 2) {
+          if (y_scale > 1) {
+            y_scale--;
+            delay(70);
+            display_obj.tft.fillRect(127, 0, 193, 28, TFT_BLACK);
+            display_obj.tftDrawXScaleButtons(x_scale);
+            display_obj.tftDrawYScaleButtons(y_scale);
+            display_obj.tftDrawChannelScaleButtons(set_channel);
+            display_obj.tftDrawExitScaleButtons();
+            //updateMidway();
+            break;
+          }
+        }
+        // Y + button pressed
+        else if (b == 3) {
+          if (y_scale < 9) {
+            y_scale++;
+            delay(70);
+            display_obj.tft.fillRect(127, 0, 193, 28, TFT_BLACK);
+            display_obj.tftDrawXScaleButtons(x_scale);
+            display_obj.tftDrawYScaleButtons(y_scale);
+            display_obj.tftDrawChannelScaleButtons(set_channel);
+            display_obj.tftDrawExitScaleButtons();
+            //updateMidway();
+            break;
+          }
+        }*/
+
+        // Channel - button pressed
+        //else if (b == 4) {
+        if (b == 4) {
+          if (set_channel > 1) {
+            Serial.println("Shit channel down");
+            set_channel--;
+            delay(70);
+            display_obj.tft.fillRect(127, 0, 193, 28, TFT_BLACK);
+            //display_obj.tftDrawXScaleButtons(x_scale);
+            //display_obj.tftDrawYScaleButtons(y_scale);
+            display_obj.tftDrawChannelScaleButtons(set_channel);
+            display_obj.tftDrawExitScaleButtons();
+            changeChannel();
+            break;
+          }
+        }
+
+        // Channel + button pressed
+        else if (b == 5) {
+          if (set_channel < MAX_CHANNEL) {
+            Serial.println("Shit channel up");
+            set_channel++;
+            delay(70);
+            display_obj.tft.fillRect(127, 0, 193, 28, TFT_BLACK);
+            //display_obj.tftDrawXScaleButtons(x_scale);
+            //display_obj.tftDrawYScaleButtons(y_scale);
+            display_obj.tftDrawChannelScaleButtons(set_channel);
+            display_obj.tftDrawExitScaleButtons();
+            changeChannel();
+            break;
+          }
+        }
+        else if (b == 6) {
+          Serial.println("Exiting packet monitor...");
+          this->StartScan(WIFI_SCAN_OFF);
+          //display_obj.tft.init();
+          this->orient_display = true;
+          return;
+        }
+      }
+    }
+
+    if (currentTime - initTime >= (GRAPH_REFRESH * 5)) {
+      //Serial.println("-----------------------------------------");
+      //Serial.println("Time elapsed: " + (String)(currentTime - initTime) + "ms");
+      x_pos += x_scale;
+      initTime = millis();
+      y_pos_x = ((-num_eapol * (y_scale * 3)) + (HEIGHT_1 - 2)); // GREEN
+      //y_pos_y = ((-num_deauth * (y_scale * 3)) + (HEIGHT_1 - 2)); // RED
+      //y_pos_z = ((-num_probe * (y_scale * 3)) + (HEIGHT_1 - 2)); // BLUE
+
+      //Serial.println("num_beacon: " + (String)num_beacon);
+      //Serial.println("num_deauth: " + (String)num_deauth);
+      //Serial.println(" num_probe: " + (String)num_probe);
+
+      //num_beacon = 0;
+      //num_probe = 0;
+      //num_deauth = 0;
+
+      //CODE FOR PLOTTING CONTINUOUS LINES!!!!!!!!!!!!
+      //Plot "X" value
+      display_obj.tft.drawLine(x_pos - x_scale, y_pos_x_old, x_pos, y_pos_x, TFT_CYAN);
+      //Plot "Z" value
+      //display_obj.tft.drawLine(x_pos - x_scale, y_pos_z_old, x_pos, y_pos_z, TFT_BLUE);
+      //Plot "Y" value
+      //display_obj.tft.drawLine(x_pos - x_scale, y_pos_y_old, x_pos, y_pos_y, TFT_RED);
+
+      //Draw preceding black 'boxes' to erase old plot lines, !!!WEIRD CODE TO COMPENSATE FOR BUTTONS AND COLOR KEY SO 'ERASER' DOESN'T ERASE BUTTONS AND COLOR KEY!!!
+      //if ((x_pos <= 90) || ((x_pos >= 198) && (x_pos <= 320))) //above x axis
+      if ((x_pos <= 90) || ((x_pos >= 117) && (x_pos <= 320))) //above x axis
+      {
+        display_obj.tft.fillRect(x_pos+1, 28, 10, 93, TFT_BLACK); //compensate for buttons!
+      }
+      else
+      {
+        display_obj.tft.fillRect(x_pos+1, 0, 10, 121, TFT_BLACK); //don't compensate for buttons!
+      }
+      //if ((x_pos >= 254) && (x_pos <= 320)) //below x axis
+      //if (x_pos <= 90)
+      if (x_pos < 0) // below x axis
+      {
+        //tft.fillRect(x_pos+1, 121, 10, 88, TFT_BLACK);
+        display_obj.tft.fillRect(x_pos+1, 121, 10, 88, TFT_CYAN);
+      }
+      else
+      {
+        //tft.fillRect(x_pos+1, 121, 10, 119, TFT_BLACK);
+        display_obj.tft.fillRect(x_pos+1, 121, 10, 118, TFT_BLACK);
+      }
+
+      //tftDisplayTime();
+
+      if ( (y_pos_x == 120) || (y_pos_y == 120) || (y_pos_z == 120) )
+      {
+        display_obj.tft.drawFastHLine(10, 120, 310, TFT_WHITE); // x axis
+      }
+
+      y_pos_x_old = y_pos_x; //set old y pos values to current y pos values 
+      //y_pos_y_old = y_pos_y;
+      //y_pos_z_old = y_pos_z;
+
+      //delay(50);
+    }
+
+    sd_obj.main();
+
   }
+
+  display_obj.tft.fillRect(127, 0, 193, 28, TFT_BLACK); //erase XY buttons and any lines behind them
+  //tft.fillRect(56, 0, 66, 32, TFT_ORANGE); //erase time and color key and any stray lines behind them
+  display_obj.tft.fillRect(12, 0, 90, 32, TFT_BLACK); // key
+
+  //display_obj.tftDrawXScaleButtons(x_scale); //redraw stuff
+  //display_obj.tftDrawYScaleButtons(y_scale);
+  display_obj.tftDrawChannelScaleButtons(set_channel);
+  display_obj.tftDrawExitScaleButtons();
+  display_obj.tftDrawEapolColorKey();
+  display_obj.tftDrawGraphObjects(x_scale);
 }
 
 void WiFiScan::packetMonitorMain(uint32_t currentTime)
@@ -1150,7 +1514,6 @@ void WiFiScan::main(uint32_t currentTime)
   // WiFi operations
   if ((currentScanMode == WIFI_SCAN_PROBE) ||
   (currentScanMode == WIFI_SCAN_AP) ||
-  (currentScanMode == WIFI_SCAN_ST) ||
   (currentScanMode == WIFI_SCAN_DEAUTH) ||
   (currentScanMode == WIFI_SCAN_ALL))
   {
@@ -1164,6 +1527,10 @@ void WiFiScan::main(uint32_t currentTime)
   {
     packetMonitorMain(currentTime);
   }
+  else if (currentScanMode == WIFI_SCAN_EAPOL)
+  {
+    eapolMonitorMain(currentTime);
+  }
   else if ((currentScanMode == WIFI_ATTACK_BEACON_SPAM))
   {
     // Need this for loop because getTouch causes ~10ms delay

+ 5 - 10
esp32_marauder/WiFiScan.h

@@ -14,10 +14,6 @@
 #include "Display.h"
 #include "SDInterface.h"
 #include "Buffer.h"
-<<<<<<< HEAD
-//#include "BatteryInterface.h"
-=======
->>>>>>> parent of 40e11b7... Capture EAPOL packets
 //#include "MenuFunctions.h"
 
 #define bad_list_length 3
@@ -27,7 +23,7 @@
 #define WIFI_SCAN_OFF 0
 #define WIFI_SCAN_PROBE 1
 #define WIFI_SCAN_AP 2
-#define WIFI_SCAN_ST 3
+#define WIFI_SCAN_EAPOL 3
 #define WIFI_SCAN_DEAUTH 4
 #define WIFI_SCAN_ALL 5
 #define WIFI_PACKET_MONITOR 6
@@ -36,17 +32,13 @@
 #define BT_SCAN_ALL 9
 #define BT_SCAN_SKIMMERS 10
 
-#define GRAPH_REFRESH 50
+#define GRAPH_REFRESH 100
 
 #define MAX_CHANNEL 14
 
 extern Display display_obj;
 extern SDInterface sd_obj;
 extern Buffer buffer_obj;
-<<<<<<< HEAD
-//extern BatteryInterface battery_obj;
-=======
->>>>>>> parent of 40e11b7... Capture EAPOL packets
 
 esp_err_t esp_wifi_80211_tx(wifi_interface_t ifx, const void *buffer, int len, bool en_sys_seq);
 
@@ -123,6 +115,7 @@ class WiFiScan
                     };
 
     void packetMonitorMain(uint32_t currentTime);
+    void eapolMonitorMain(uint32_t currentTime);
     void changeChannel();
     void updateMidway();
     void tftDrawXScalButtons();
@@ -136,6 +129,7 @@ class WiFiScan
     void RunBeaconSpam(uint8_t scan_mode, uint16_t color);
     void RunBeaconScan(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);
     void RunPacketMonitor(uint8_t scan_mode, uint16_t color);
     void RunBluetoothScan(uint8_t scan_mode, uint16_t color);
@@ -162,6 +156,7 @@ class WiFiScan
     static void beaconSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type);
     static void deauthSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type);
     static void probeSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type);
+    static void eapolSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type);
     static void wifiSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type);
 };
 #endif

+ 2 - 20
esp32_marauder/esp32_marauder.ino

@@ -14,10 +14,6 @@ https://www.online-utility.org/image/convert/to/XBM
 #include "freertos/task.h"
 #include "esp_system.h"
 #include <Arduino.h>
-<<<<<<< HEAD
-//#include <Preferences.h>
-=======
->>>>>>> parent of 40e11b7... Capture EAPOL packets
 
 
 #include "Assets.h"
@@ -27,10 +23,6 @@ https://www.online-utility.org/image/convert/to/XBM
 #include "SDInterface.h"
 #include "Web.h"
 #include "Buffer.h"
-<<<<<<< HEAD
-//#include "BatteryInterface.h"
-=======
->>>>>>> parent of 40e11b7... Capture EAPOL packets
 //#include "icons.h"
 
 Display display_obj;
@@ -39,22 +31,11 @@ MenuFunctions menu_function_obj;
 SDInterface sd_obj;
 Web web_obj;
 Buffer buffer_obj;
-<<<<<<< HEAD
-//BatteryInterface battery_obj;
-
-//Preferences preferences;
-=======
->>>>>>> parent of 40e11b7... Capture EAPOL packets
 
 uint32_t currentTime  = 0;
 
 void setup()
 {
-<<<<<<< HEAD
-
-  //Serial.println("\n\n-------------------------------------\n");
-=======
->>>>>>> parent of 40e11b7... Capture EAPOL packets
 
   pinMode(FLASH_BUTTON, INPUT);
   pinMode(TFT_BL, OUTPUT);
@@ -103,7 +84,8 @@ void loop()
     wifi_scan_obj.main(currentTime);
     sd_obj.main();
     //if ((wifi_scan_obj.currentScanMode != WIFI_ATTACK_BEACON_SPAM))
-    if (wifi_scan_obj.currentScanMode != WIFI_PACKET_MONITOR)
+    if ((wifi_scan_obj.currentScanMode != WIFI_PACKET_MONITOR) &&
+        (wifi_scan_obj.currentScanMode != WIFI_SCAN_EAPOL))
       menu_function_obj.main();
       if (wifi_scan_obj.currentScanMode == OTA_UPDATE)
         web_obj.main();

BIN
pictures/icons/eapol_22.bmp


+ 9 - 0
pictures/xbm/eapol_22.XBM

@@ -0,0 +1,9 @@
+#define 1584799606553_width 22
+#define 1584799606553_height 22
+static char 1584799606553_bits[] = {
+  0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0x3B, 0xFF, 0xFF, 0x39, 
+  0xFF, 0xFF, 0x3C, 0xFF, 0x7F, 0x3A, 0xFF, 0x3F, 0x37, 0xFF, 0x9F, 0x3E, 
+  0xFF, 0xCF, 0x3D, 0xFF, 0xE7, 0x3F, 0xFF, 0xF3, 0x3F, 0xCF, 0xF9, 0x3F, 
+  0xB7, 0xFC, 0x3F, 0x77, 0xFE, 0x3F, 0xF7, 0xFE, 0x3F, 0xEF, 0xFD, 0x3F, 
+  0xDF, 0xFB, 0x3F, 0xBF, 0xFB, 0x3F, 0x7F, 0xFC, 0x3F, 0xFF, 0xFF, 0x3F, 
+  0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0x3F, };