9#include <tins/ethernetII.h>
256 std::set<MACAddress> result;
257 for (
const auto &[addr, _] : clients)
267 if (!clients.count(addr))
269 return clients[addr];
277 if (!clients_security.count(addr))
279 return clients_security[addr];
301 std::optional<Recording::info>
302 save_traffic(
const std::filesystem::path &save_path,
const std::string &name);
310 std::optional<Recording::info>
312 const std::string &name);
338 bool handle_data(Tins::Packet *pkt);
344 bool handle_management(Tins::Packet *pkt);
351 void update_client_metadata(
const Tins::Packet &pkt);
357 std::vector<NetworkSecurity>
358 detect_security_modes(
const Tins::Dot11ManagementFrame &mgmt)
const;
364 std::vector<wifi_standard_info>
365 detect_wifi_capabilities(
const Tins::Dot11ManagementFrame &mgmt)
const;
372 bool check_pmf_capable(
const Tins::Dot11ManagementFrame &mgmt)
const;
379 bool check_pmf_required(
const Tins::Dot11ManagementFrame &mgmt)
const;
385 bool is_ccmp(
const Tins::Dot11ManagementFrame &mgmt)
const;
388 uint32_t decrypted_pkt_count = 0;
389 std::shared_ptr<spdlog::logger> logger;
392 int wifi_channel = 0;
393 std::vector<Tins::Packet *> captured_packets;
395 std::vector<std::shared_ptr<PacketChannel>> converted_channels;
396 std::vector<wifi_standard_info> wifi_stds_supported;
399 uint8_t radio_length = 0;
400 uint8_t radio_channel_freq = 0;
401 uint8_t radio_channel_type = 0;
402 uint8_t radio_antenna = 0;
404 bool capabilities_detected =
false;
405 std::vector<NetworkSecurity> security_modes;
406 bool pmf_supported =
false;
407 bool pmf_required =
false;
408 bool uses_ccmp =
false;
409 std::unordered_map<MACAddress, client_info> clients;
410 std::unordered_map<MACAddress, client_security> clients_security;
Access Point in a basic service set (BSS) network.
Definition access_point.h:20
NetworkSecurity
Network security protocol used. A network can support multiple ways to connect and secure data.
Definition access_point.h:26
std::optional< Recording::info > save_decrypted_traffic(const std::filesystem::path &save_path, const std::string &name)
Definition access_point.cpp:199
std::optional< Recording::info > save_traffic(const std::filesystem::path &save_path, const std::string &name)
Definition access_point.cpp:191
MACAddress get_bssid() const
Definition access_point.cpp:45
const std::optional< client_security > get_client_security(MACAddress addr)
Definition access_point.h:276
uint32_t decrypted_packet_count() const
Definition access_point.cpp:186
const std::optional< client_info > get_client(MACAddress addr)
Definition access_point.h:266
bool unicast_decryption_supported() const
Definition access_point.cpp:146
bool handle_pkt(Tins::Packet *pkt)
Definition access_point.cpp:33
AccessPoint(const MACAddress &bssid, const SSID &ssid, int wifi_channel, Database &db)
Definition access_point.cpp:24
DecryptionState
Current state of decryption.
Definition access_point.h:39
SSID get_ssid() const
Definition access_point.cpp:43
bool protected_management_required() const
Definition access_point.cpp:172
std::vector< wifi_standard_info > standards_supported() const
Definition access_point.cpp:49
std::shared_ptr< PacketChannel > get_decrypted_channel()
Definition access_point.cpp:53
DecryptionState add_password(const std::string &psk)
Definition access_point.cpp:73
bool client_decryption_supported(const MACAddress &client)
Definition access_point.cpp:158
bool protected_management_supported() const
Definition access_point.cpp:168
std::vector< NetworkSecurity > security_supported() const
Definition access_point.cpp:142
std::string get_oid() const
Definition access_point.cpp:740
WiFiStandard
Definition access_point.h:50
void set_vendor()
Definition access_point.cpp:730
WPA2Decrypter & get_decrypter()
Definition access_point.cpp:180
Modulation
Definition access_point.h:62
const std::set< MACAddress > get_clients()
Definition access_point.h:255
bool group_decryption_supported() const
Definition access_point.cpp:151
std::string supported_security_text() const
bool send_deauth(const Tins::NetworkInterface &iface, const MACAddress &addr)
Definition access_point.cpp:100
bool protected_management(const MACAddress &client)
Definition access_point.cpp:174
bool has_working_password() const
Definition access_point.cpp:138
std::string get_vendor() const
Definition access_point.cpp:739
uint32_t raw_packet_count() const
Definition access_point.cpp:182
int get_wifi_channel() const
Definition access_point.cpp:47
ChannelWidth
Definition access_point.h:75
void close_all_channels()
Definition access_point.cpp:68
Decrypts unicast, multicast and broadcast WPA2 packets.
Definition decrypter.h:25
Definition access_point.cpp:22
std::string SSID
Definition decrypter.h:19
Tins::HWAddress< 6 > MACAddress
Definition decrypter.h:20
Client information.
Definition access_point.h:104
int8_t noise
Definition access_point.h:113
std::string ipv4
Definition access_point.h:107
std::string hostname
Definition access_point.h:106
int8_t snr
Definition access_point.h:114
uint32_t sent_total
Definition access_point.h:110
std::string hwaddr
Definition access_point.h:105
uint32_t received
Definition access_point.h:111
int8_t rrsi
Definition access_point.h:112
uint32_t sent_unicast
Definition access_point.h:109
std::string ipv6
Definition access_point.h:108
Connection security info of a specific client.
Definition access_point.h:120
bool is_ccmp
Definition access_point.h:122
NetworkSecurity security
Definition access_point.h:121
bool pmf
Definition access_point.h:123
std::optional< Tins::RSNInformation::CypherSuites > pairwise_cipher
Definition access_point.h:124
WiFi standard capabilities for the network.
Definition access_point.h:86
WiFiStandard std
Definition access_point.h:87
bool single_beamformer_support
Definition access_point.h:88
std::set< ChannelWidth > channel_widths_supported
Definition access_point.h:98
std::set< Modulation > modulation_supported
Definition access_point.h:93
bool single_beamformee_support
Definition access_point.h:89
std::set< uint8_t > mcs_supported_idx
Definition access_point.h:92
std::set< uint8_t > spatial_streams_supported
Definition access_point.h:95
bool multi_beamformer_support
Definition access_point.h:90
bool multi_beamformee_support
Definition access_point.h:91