5#ifndef POLITICIAN_NO_STD_FUNCTION
24#define CAP_EAPOL_CSA 0x03
25#define CAP_EAPOL_HALF 0x04
26#define CAP_EAPOL_GROUP 0x05
39#define ATTACK_PMKID 0x01
40#define ATTACK_CSA 0x02
41#define ATTACK_PASSIVE 0x04
42#define ATTACK_DEAUTH 0x08
43#define ATTACK_STIMULATE 0x10
44#define ATTACK_BTM 0x20
45#define ATTACK_ALL 0x3F
52#define LOG_FILTER_HANDSHAKES 0x01
53#define LOG_FILTER_PROBES 0x02
54#define LOG_FILTER_BEACONS 0x04
55#define LOG_FILTER_PROBE_REQ 0x08
56#define LOG_FILTER_MGMT_DISRUPT 0x10
57#define LOG_FILTER_ALL 0xFF
60#ifndef POLITICIAN_NO_STD_FUNCTION
61using LogCb = std::function<void(
const char *msg)>;
63typedef void (*
LogCb)(
const char *msg);
73#ifndef POLITICIAN_NO_MSCHAPV2
79typedef void (*
PacketCb)(
const uint8_t *payload, uint16_t len, int8_t rssi, uint8_t channel, uint32_t ts_usec);
85#ifndef POLITICIAN_NO_MSCHAPV2
140#ifndef POLITICIAN_NO_KARMA
167 auto w = [&](
const char *msg) {
if (n < maxOut) out[n++] = msg; };
169 w(
"hop_min_dwell_ms >= hop_max_dwell_ms — max will be clamped to min+50ms");
171 w(
"fish_timeout_ms < 500 — will be clamped to 500ms");
173 w(
"csa_wait_ms < 1000 — will be clamped to 1000ms");
175 w(
"hop_dwell_ms = 0 — hopper will spin with no delay");
177 w(
"deauth_burst_count = 0 — deauth attacks send zero frames");
179 w(
"csa_beacon_count = 0 — CSA attacks send zero beacons");
181 w(
"probe_aggr_interval_s = 0 — APs attacked every beacon (very aggressive)");
183 w(
"min_rssi out of useful range [-100, -20] dBm");
264 uint8_t eapol_m2[256];
265 uint8_t sae_data[256];
270 uint16_t eapol_m2_len;
336#ifndef POLITICIAN_NO_STD_FUNCTION
343#ifndef POLITICIAN_NO_KARMA
361#ifndef POLITICIAN_NO_STD_FUNCTION
433#ifndef POLITICIAN_NO_MSCHAPV2
457#define FP_MATCH_OUI 0x01
458#define FP_MATCH_PROBE_SSID 0x02
459#define FP_MATCH_HT_CAP 0x04
460#define FP_MATCH_RATES 0x08
461#define FP_MATCH_IE_FLAGS 0x10
464#define FP_IEF_NO_HT 0x01
465#define FP_IEF_NO_EXT_CAP 0x02
466#define FP_IEF_HAS_WMM 0x04
467#define FP_IEF_HAS_WPS 0x08
#define LOG_FILTER_HANDSHAKES
#define LOG_FILTER_PROBES
void(* EapolCb)(const HandshakeRecord &rec)
char vendor[32]
OUI vendor string; empty if POLITICIAN_NO_DB is defined.
static const uint8_t CIPHER_UNKNOWN
uint16_t channel_frames[200]
void(* MsChapCb)(const MsChapRecord &rec)
int8_t rssi
Signal strength at time of observation (dBm)
uint8_t sta[6]
Client (station) MAC address.
const char * soft_ap_ssid
bool deauth_reason_cycling
uint32_t probe_hidden_interval_ms
void(* AttackResultCb)(const AttackResultRecord &rec)
int(* TargetScoreCb)(const ApRecord &ap, const char *vendor)
bool skip_immune_networks
uint16_t hop_max_dwell_ms
uint32_t first_seen_ms
millis() when this client was first seen on this BSSID
uint8_t eap_method
EAP method negotiated by the AP (EAP_METHOD_* constant); 0 if not yet observed.
static const uint8_t EAP_METHOD_TLS
EAP-TLS (RFC 5216) — mutual cert auth.
uint8_t server_challenge[16]
uint8_t cipher
Pairwise cipher suite: CIPHER_TKIP / CIPHER_CCMP / CIPHER_UNKNOWN.
static const uint8_t EAP_METHOD_MSCHAPV2
Bare EAP-MSCHAPv2 (no tunnel — crackable)
void(* WpsCb)(const WpsRecord &rec)
void(* ProbeRequestCb)(const ProbeRequestRecord &rec)
int validateConfig(const Config &cfg, const char **out, uint8_t maxOut)
Validates a Config struct and returns human-readable warning strings for values that will be silently...
bool capture_half_handshakes
static const uint8_t EAP_METHOD_PEAP
PEAP (draft-josefsson-pppext-eap-tls-eap) — outer tunnel.
uint16_t probe_aggr_interval_s
uint32_t last_seen_ms
millis() of the most recent frame from this client
uint16_t primary_dev_type_cat
uint16_t beacon_count
Number of beacons observed from this AP in the current session.
static const uint8_t EAP_METHOD_IDENTITY
EAP Identity (always 0x01 for harvested records)
void(* ApFoundCb)(const ApRecord &ap)
static const uint8_t EAP_METHOD_TTLS
EAP-TTLS (RFC 5281) — outer tunnel, inner MSCHAPv2.
bool rand_mac
True if the locally administered bit is set (MAC randomization)
static const uint8_t CIPHER_TKIP
TKIP (00-0F-AC:2) — legacy, crackable offline.
static const uint8_t CIPHER_CCMP
CCMP/AES (00-0F-AC:4) — current standard.
void(* IdentityCb)(const EapIdentityRecord &rec)
uint16_t hop_min_dwell_ms
uint32_t last_attack_ms
millis() of the most recent attack initiation (0 = never attacked)
uint8_t peer_challenge[16]
bool require_active_clients
uint8_t bssid[6]
BSSID of the AP this client is associated with.
std::function< void(const KarmaRecord &rec)> KarmaCb
std::function< void(const char *msg)> LogCb
void(* PacketCb)(const uint8_t *payload, uint16_t len, int8_t rssi, uint8_t channel, uint32_t ts_usec)
uint8_t max_total_attempts
volatile uint32_t dropped
void(* ClientFoundCb)(const ClientRecord &rec)
std::function< void(const RogueApRecord &rec)> RogueApCb
@ ERR_MAX_INSTANCES
Returned by begin() when all POLITICIAN_MAX_INSTANCES slots are occupied.
uint32_t session_timeout_ms
void(* DisruptCb)(const DisruptRecord &rec)
uint8_t capture_count
Number of successful handshake/PMKID captures for this BSSID.
uint16_t btm_disassoc_timer
uint8_t deauth_burst_count
Snapshot of a discovered Access Point from the internal cache.
Identifies the AP and failure reason for a failed attack, delivered to the AttackResultCb callback.
Snapshot of a client station observed associated with an AP.
Configuration for the Politician engine.
One fingerprint entry in the built-in or user-defined database.
A matched device, delivered to the DeviceFoundCb callback.
A deauthentication or disassociation frame observed on the air, delivered to the DisruptCb callback.
A harvested 802.1X Enterprise plaintext identity, delivered to the IdentityCb callback.
A captured handshake or PMKID record delivered to the EapolCb callback.
Delivered to the KarmaCb callback when the KARMA responder replies to a named probe request.
Bare EAP-MSCHAPv2 challenge/response pair harvested passively.
A probe request frame observed on the air, delivered to the ProbeRequestCb callback.
Fired when a second BSSID advertising the same SSID is observed on the same channel.
Cumulative frame and capture counters for the engine session.
WPS M1 device attributes harvested from an EAP-WSC exchange.