|
Politician 1.0.0
WiFi Auditing Library for ESP32
|
The core WiFi handshake capturing engine. More...
#include <Politician.h>
Public Types | |
| using | EapolCb = void(*)(const HandshakeRecord &rec) |
| using | ApFoundCb = void(*)(const ApRecord &ap) |
| using | FilterCb = bool(*)(const ApRecord &ap) |
| using | PacketCb = void(*)(const uint8_t *payload, uint16_t len, int8_t rssi, uint32_t ts_usec) |
| using | IdentityCb = void(*)(const EapIdentityRecord &rec) |
Public Member Functions | |
| Politician () | |
| Error | begin (const Config &cfg=Config()) |
| Initializes the WiFi driver in promiscuous mode. | |
| void | setLogger (LogCb cb) |
| Sets a custom logging callback to intercept library output. | |
| void | markCaptured (const uint8_t *bssid) |
| Manually adds a BSSID to the "already captured" list to skip it. | |
| void | clearCapturedList () |
| Clears the captured BSSID list. | |
| void | setIgnoreList (const uint8_t(*bssids)[6], uint8_t count) |
| Sets a list of BSSIDs that should always be ignored by the engine. | |
| void | setActive (bool active) |
| Enables or disables frame processing. | |
| Error | setChannel (uint8_t ch) |
| Manually sets the WiFi radio to a specific channel. | |
| void | startHopping (uint16_t dwellMs=0) |
| Starts autonomous channel hopping. | |
| void | stopHopping () |
| Stops autonomous channel hopping and goes idle. | |
| Error | lockChannel (uint8_t ch) |
| Stops hopping and locks the radio to a specific channel. | |
| void | setChannelList (const uint8_t *channels, uint8_t count) |
| Restricts hopping to a specific list of channels. | |
| void | tick () |
| Main worker method. | |
| void | setAttackMask (uint8_t mask) |
| Configures which attack techniques are enabled. | |
| Error | setTarget (const uint8_t *bssid, uint8_t channel) |
| Focuses the engine on a single BSSID. | |
| void | clearTarget () |
| Clears the specific target and resumes autonomous wardriving. | |
| bool | hasTarget () const |
| uint8_t | getChannel () const |
| bool | isActive () const |
| int8_t | getLastRssi () const |
| Stats & | getStats () |
| Config & | getConfig () |
| void | setEapolCallback (EapolCb cb) |
| Sets the callback for when a handshake (EAPOL or PMKID) is captured. | |
| void | setApFoundCallback (ApFoundCb cb) |
| Sets the callback for when a new Access Point is discovered. | |
| void | setTargetFilter (FilterCb cb) |
| Sets an early filter callback. | |
| void | setPacketLogger (PacketCb cb) |
| Sets the callback for raw promiscuous mode packets. | |
| void | setIdentityCallback (IdentityCb cb) |
| Sets the callback for passive 802.1X Enterprise Identity harvesting. | |
The core WiFi handshake capturing engine.
Definition at line 89 of file Politician.h.
| using politician::Politician::ApFoundCb = void (*)(const ApRecord &ap) |
Definition at line 196 of file Politician.h.
| using politician::Politician::EapolCb = void (*)(const HandshakeRecord &rec) |
Definition at line 195 of file Politician.h.
| using politician::Politician::FilterCb = bool (*)(const ApRecord &ap) |
Definition at line 197 of file Politician.h.
| using politician::Politician::IdentityCb = void (*)(const EapIdentityRecord &rec) |
Definition at line 199 of file Politician.h.
| using politician::Politician::PacketCb = void (*)(const uint8_t *payload, uint16_t len, int8_t rssi, uint32_t ts_usec) |
Definition at line 198 of file Politician.h.
| politician::Politician::Politician | ( | ) |
Definition at line 37 of file Politician.cpp.
Initializes the WiFi driver in promiscuous mode.
| cfg | Optional configuration struct. |
Definition at line 82 of file Politician.cpp.
References politician::ERR_WIFI_INIT, and politician::OK.
Referenced by setup().
| void politician::Politician::clearCapturedList | ( | ) |
Clears the captured BSSID list.
Definition at line 149 of file Politician.cpp.
| void politician::Politician::clearTarget | ( | ) |
Clears the specific target and resumes autonomous wardriving.
Definition at line 213 of file Politician.cpp.
|
inline |
Definition at line 181 of file Politician.h.
|
inline |
Definition at line 193 of file Politician.h.
|
inline |
Definition at line 187 of file Politician.h.
|
inline |
Definition at line 190 of file Politician.h.
Referenced by loop().
|
inline |
Definition at line 178 of file Politician.h.
|
inline |
Definition at line 184 of file Politician.h.
| Error politician::Politician::lockChannel | ( | uint8_t | ch | ) |
Stops hopping and locks the radio to a specific channel.
Definition at line 136 of file Politician.cpp.
References setChannel().
| void politician::Politician::markCaptured | ( | const uint8_t * | bssid | ) |
Manually adds a BSSID to the "already captured" list to skip it.
Definition at line 157 of file Politician.cpp.
| void politician::Politician::setActive | ( | bool | active | ) |
Enables or disables frame processing.
Definition at line 123 of file Politician.cpp.
Referenced by setup().
|
inline |
Sets the callback for when a new Access Point is discovered.
Definition at line 209 of file Politician.h.
Referenced by setup().
| void politician::Politician::setAttackMask | ( | uint8_t | mask | ) |
Configures which attack techniques are enabled.
Definition at line 181 of file Politician.cpp.
References ATTACK_CSA, ATTACK_PASSIVE, and ATTACK_PMKID.
Referenced by setup().
| Error politician::Politician::setChannel | ( | uint8_t | ch | ) |
Manually sets the WiFi radio to a specific channel.
| ch | Channel number (2.4GHz: 1-14, 5GHz: 36-165) |
Definition at line 129 of file Politician.cpp.
References politician::ERR_INVALID_CH, politician::isValidChannel(), and politician::OK.
Referenced by lockChannel().
| void politician::Politician::setChannelList | ( | const uint8_t * | channels, |
| uint8_t | count | ||
| ) |
Restricts hopping to a specific list of channels.
| channels | Array of channel numbers (2.4GHz: 1-14, 5GHz: 36-165) |
| count | Number of channels in array |
Definition at line 219 of file Politician.cpp.
References politician::isValidChannel(), and POLITICIAN_MAX_CHANNELS.
|
inline |
Sets the callback for when a handshake (EAPOL or PMKID) is captured.
Definition at line 204 of file Politician.h.
Referenced by setup().
|
inline |
Sets the callback for passive 802.1X Enterprise Identity harvesting.
Definition at line 224 of file Politician.h.
| void politician::Politician::setIgnoreList | ( | const uint8_t(*) | bssids[6], |
| uint8_t | count | ||
| ) |
Sets a list of BSSIDs that should always be ignored by the engine.
Definition at line 141 of file Politician.cpp.
|
inline |
Sets a custom logging callback to intercept library output.
Definition at line 103 of file Politician.h.
|
inline |
Sets the callback for raw promiscuous mode packets.
Definition at line 219 of file Politician.h.
| Error politician::Politician::setTarget | ( | const uint8_t * | bssid, |
| uint8_t | channel | ||
| ) |
Focuses the engine on a single BSSID.
Definition at line 188 of file Politician.cpp.
References politician::ERR_ALREADY_CAPTURED, and politician::OK.
|
inline |
Sets an early filter callback.
If it returns false, the AP is ignored completely.
Definition at line 214 of file Politician.h.
| void politician::Politician::startHopping | ( | uint16_t | dwellMs = 0 | ) |
Starts autonomous channel hopping.
| dwellMs | Time in milliseconds to stay on each channel (0 = use config). |
Definition at line 167 of file Politician.cpp.
References politician::Config::hop_dwell_ms.
Referenced by setup().
| void politician::Politician::stopHopping | ( | ) |
Stops autonomous channel hopping and goes idle.
Definition at line 176 of file Politician.cpp.
| void politician::Politician::tick | ( | ) |
Main worker method.
Must be called frequently from loop().
Definition at line 237 of file Politician.cpp.
References politician::Stats::captures, politician::Stats::data, politician::Stats::eapol, politician::Config::hop_dwell_ms, politician::Stats::mgmt, politician::Stats::pmkid_found, politician::Config::session_timeout_ms, and politician::Stats::total.
Referenced by loop().