Packet sniffer and handler in charge of tracking, information gathering and decrypting passing data.
More...
#include <sniffer.h>
Packet sniffer and handler in charge of tracking, information gathering and decrypting passing data.
◆ network_name
◆ Sniffer() [1/2]
yarilo::Sniffer::Sniffer |
( |
std::unique_ptr< Tins::FileSniffer > | sniffer, |
|
|
const std::filesystem::path & | filepath, |
|
|
Database & | db ) |
A constructor to create the Sniffer without network card support
- Parameters
-
[in] | sniffer | Tins::FileSniffer instance |
◆ Sniffer() [2/2]
yarilo::Sniffer::Sniffer |
( |
std::unique_ptr< Tins::Sniffer > | sniffer, |
|
|
const Tins::NetworkInterface & | iface, |
|
|
Database & | db ) |
A constructor to create the Sniffer with network card support
- Parameters
-
[in] | sniffer | Tins::Sniffer instance |
[in] | iface | Network interface to use |
◆ ~Sniffer()
yarilo::Sniffer::~Sniffer |
( |
| ) |
|
|
inline |
◆ add_ignored_network() [1/2]
void yarilo::Sniffer::add_ignored_network |
( |
const MACAddress & | bssid | ) |
|
Ignore network and delete any access point with this address
- Parameters
-
[in] | bssid | Address of the network to ignore |
◆ add_ignored_network() [2/2]
void yarilo::Sniffer::add_ignored_network |
( |
const SSID & | ssid | ) |
|
Ignore network and delete any access point with this SSID
- Parameters
-
[in] | ssid | SSID of the network to ignore |
◆ all_networks()
Get the available networks, use get_network
to get a specific network
- Returns
- names of available networks along with their BSSID
◆ available_recordings()
static std::vector< Recording::info > yarilo::Sniffer::available_recordings |
( |
const std::filesystem::path & | save_path | ) |
|
|
static |
Get the recordings available in the saves directory
- Parameters
-
[in] | save_path | Path where the recordings are stored |
- Returns
- Recording filenames to choose from
◆ detect_interface()
std::optional< std::string > yarilo::Sniffer::detect_interface |
( |
std::shared_ptr< spdlog::logger > | log, |
|
|
const std::string & | ifname ) |
|
static |
Try to detect if a logical interface is suitable for sniffing. If the supplied logical interface fails, searching in the same phy might yield a suitable interface
- Parameters
-
[in] | log | Logger to use |
[in] | ifname | Logical interface name |
- Returns
- Logical interface to sniff on if available, nullopt otherwise
◆ file()
std::optional< std::filesystem::path > yarilo::Sniffer::file |
( |
| ) |
|
Get the used filepath (if applicable)
- Returns
- Used filepath
◆ focus_network() [1/2]
std::optional< uint32_t > yarilo::Sniffer::focus_network |
( |
const MACAddress & | bssid | ) |
|
Focus a specific network by BSSID
- Parameters
-
[in] | bssid | Basic sevice set identifier of the network to be focused (network addr) |
- Returns
- Optionally return the channel that the network is on
◆ focus_network() [2/2]
std::optional< uint32_t > yarilo::Sniffer::focus_network |
( |
const SSID & | ssid | ) |
|
Focus a specific network by SSID
- Parameters
-
[in] | ssid | Sevice set identifier of the network to be focused (network name) |
- Returns
- Optionally return the channel that the network is on
◆ focused_network()
std::optional< std::shared_ptr< AccessPoint > > yarilo::Sniffer::focused_network |
( |
| ) |
|
Get the focused network
- Returns
- Focused network if focusing is enabled, nullopt otherwise
◆ get_bssid()
std::optional< MACAddress > yarilo::Sniffer::get_bssid |
( |
const SSID & | ssid | ) |
|
Find the first network with the given SSID
- Parameters
-
[in] | ssid | SSID of the searched network |
- Returns
- BSSID of the taget network
◆ get_network() [1/2]
Get the details of a network by BSSID, use all_networks
to get all the network names
- Parameters
-
- Returns
AccessPoint
information if the BSSID exists, nullopt otherwise
◆ get_network() [2/2]
std::optional< std::shared_ptr< AccessPoint > > yarilo::Sniffer::get_network |
( |
const SSID & | ssid | ) |
|
Get the details of a network by SSID, use all_networks
to get all the network names. In the case of multiple APs with the same SSID, the first one is chosen
- Parameters
-
- Returns
AccessPoint
information if the SSID exists, nullopt otherwise
◆ iface()
std::optional< std::string > yarilo::Sniffer::iface |
( |
| ) |
|
Get the used interface (if applicable)
- Returns
- Used net logical interface
◆ ignored_networks()
std::unordered_map< MACAddress, SSID > yarilo::Sniffer::ignored_networks |
( |
| ) |
|
Get the ignored networks
- Returns
- ssids of ignored networks
◆ save_decrypted_traffic()
std::optional< recording_info > yarilo::Sniffer::save_decrypted_traffic |
( |
const std::filesystem::path & | save_path, |
|
|
const std::string & | name ) |
Save decrypted traffic
- Parameters
-
[in] | directory | in which the recording should live |
[in] | name | of the recording |
- Returns
- An optional containing some info about the recording.
◆ save_traffic()
std::optional< recording_info > yarilo::Sniffer::save_traffic |
( |
const std::filesystem::path & | saves_path, |
|
|
const std::string & | name ) |
Save all traffic (in 802.11 data link)
- Parameters
-
[in] | directory | in which the recording should live |
[in] | name | of the recording |
- Returns
- An optional containing some info about the recording.
◆ shutdown()
void yarilo::Sniffer::shutdown |
( |
| ) |
|
◆ start()
void yarilo::Sniffer::start |
( |
| ) |
|
◆ stop_focus()
void yarilo::Sniffer::stop_focus |
( |
| ) |
|
Stop focusing the current focused network
◆ NoAddress
The documentation for this class was generated from the following files:
- /tmp/nix-build-Yarilo-0.9.9.drv-0/backend/src/sniffer.h
- /tmp/nix-build-Yarilo-0.9.9.drv-0/backend/src/sniffer.cpp