esp32_marauder/WiFiScan.cpp
// Function for sending crafted beacon frames
Function for sending crafted beacon frames
Function for sending crafted beacon frames
void WiFiScan::broadcastRandomSSID(uint32_t currentTime) {
  set_channel = random(1,12);
  esp_wifi_set_channel(set_channel, WIFI_SECOND_CHAN_NONE);
  delay(1);
  packet[10] = packet[16] = random(256);
  packet[11] = packet[17] = random(256);
  packet[12] = packet[18] = random(256);
  packet[13] = packet[19] = random(256);
  packet[14] = packet[20] = random(256);
  packet[15] = packet[21] = random(256);
  packet[37] = 6;
  packet[38] = alfa[random(65)];
  packet[39] = alfa[random(65)];
  packet[40] = alfa[random(65)];
  packet[41] = alfa[random(65)];
  packet[42] = alfa[random(65)];
  packet[43] = alfa[random(65)];
  packet[56] = set_channel;
  uint8_t postSSID[13] = {0x01, 0x08, 0x82, 0x84, 0x8b, 0x96, 0x24, 0x30, 0x48, 0x6c, 
                      0x03, 0x01, 0x04  };
  for(int i = 0; i < 12; i++)
    packet[38 + 6 + i] = postSSID[i];
  esp_wifi_80211_tx(WIFI_IF_AP, packet, sizeof(packet), false);
  esp_wifi_80211_tx(WIFI_IF_AP, packet, sizeof(packet), false);
  esp_wifi_80211_tx(WIFI_IF_AP, packet, sizeof(packet), false);
  packets_sent = packets_sent + 3;
}
void WiFiScan :: broadcastRandomSSID ( uint32_t currentTime ) { set_channel = random ( 1 , 12 ) ; esp_wifi_set_channel ( set_channel , WIFI_SECOND_CHAN_NONE ) ; delay ( 1 ) ; packet [ 10 ] = packet [ 16 ] = random ( 256 ) ; packet [ 11 ] = packet [ 17 ] = random ( 256 ) ; packet [ 12 ] = packet [ 18 ] = random ( 256 ) ; packet [ 13 ] = packet [ 19 ] = random ( 256 ) ; packet [ 14 ] = packet [ 20 ] = random ( 256 ) ; packet [ 15 ] = packet [ 21 ] = random ( 256 ) ; packet [ 37 ] = 6 ; packet [ 38 ] = alfa [ random ( 65 ) ] ; packet [ 39 ] = alfa [ random ( 65 ) ] ; packet [ 40 ] = alfa [ random ( 65 ) ] ; packet [ 41 ] = alfa [ random ( 65 ) ] ; packet [ 42 ] = alfa [ random ( 65 ) ] ; packet [ 43 ] = alfa [ random ( 65 ) ] ; packet [ 56 ] = set_channel ; uint8_t postSSID [ 13 ] = { 0x01 , 0x08 , 0x82 , 0x84 , 0x8b , 0x96 , 0x24 , 0x30 , 0x48 , 0x6c , 0x03 , 0x01 , 0x04 } ; for ( int i = 0 ; i < 12 ; i ++ ) packet [ 38 + 6 + i ] = postSSID [ i ] ; esp_wifi_80211_tx ( WIFI_IF_AP , packet , sizeof ( packet ) , false ) ; esp_wifi_80211_tx ( WIFI_IF_AP , packet , sizeof ( packet ) , false ) ; esp_wifi_80211_tx ( WIFI_IF_AP , packet , sizeof ( packet ) , false ) ; packets_sent = packets_sent + 3 ; }
Function for sending crafted beacon frames
Function for sending crafted beacon frames
// Randomize SRC MAC // Randomize SSID (Fixed size 6. Lazy right?) //supported rate /*DSSS (Current Channel)*/ // Add everything that goes after the SSID //Serial.println("About to send packets..."); //esp_wifi_80211_tx(WIFI_IF_AP, packet, sizeof(packet), false); //esp_wifi_80211_tx(WIFI_IF_AP, packet, sizeof(packet), false); //esp_wifi_80211_tx(WIFI_IF_AP, packet, sizeof(packet), false); //Serial.print("Packets sent: "); //Serial.println(packets_sent); //Serial.println("Sent packets");