Yarilo v0.9.9
WPA2 Decrypter & Packet Analyzer
Loading...
Searching...
No Matches
yarilo::WPA2Decrypter Class Reference

Decrypts unicast, multicast and broadcast WPA2 packets. More...

#include <decrypter.h>

Classes

struct  client_window
 Represents a client window for tracking packet data within an encryption window. This window is defined as the state between successful 4-way handshakes between the supplicant (client) and the authenticator. More...
 
struct  group_window
 Represents a group window for tracking multicast packet data. This window is defined as the state between successful group key rotations. More...
 

Public Types

typedef std::vector< uint8_t > ptk_type
 
typedef std::vector< uint8_t > gtk_type
 

Public Member Functions

 WPA2Decrypter (const MACAddress &bssid, const SSID &ssid)
 
bool decrypt (Tins::Packet *pkt)
 
bool can_generate_keys () const
 
void add_password (const std::string &psk)
 
bool has_working_password () const
 
std::optional< std::string > get_password () const
 
std::set< MACAddressget_clients () const
 
std::optional< client_windowget_current_client_window (const MACAddress &client)
 
std::optional< std::vector< client_window > > get_all_client_windows (const MACAddress &client)
 
group_window get_current_group_window () const
 
std::vector< group_windowget_all_group_windows () const
 
uint32_t count_all_group_windows () const
 
std::optional< std::string > extract_hc22000 (const client_window &client)
 

Static Public Member Functions

static std::string readable_hex (const std::vector< uint8_t > &vec)
 

Detailed Description

Decrypts unicast, multicast and broadcast WPA2 packets.

Member Typedef Documentation

◆ gtk_type

typedef std::vector<uint8_t> yarilo::WPA2Decrypter::gtk_type

◆ ptk_type

typedef std::vector<uint8_t> yarilo::WPA2Decrypter::ptk_type

Constructor & Destructor Documentation

◆ WPA2Decrypter()

yarilo::WPA2Decrypter::WPA2Decrypter ( const MACAddress & bssid,
const SSID & ssid )

Constructor for WPA2Decrypter

Parameters
[in]bssidThe MAC address of the access point
[in]ssidThe SSID of the network

Member Function Documentation

◆ add_password()

void yarilo::WPA2Decrypter::add_password ( const std::string & psk)

Adds a password for decryption

Parameters
[in]pskThe password (pre-shared key) to add

◆ can_generate_keys()

bool yarilo::WPA2Decrypter::can_generate_keys ( ) const

Checks if the decrypter is ready to generate

Returns
True if a valid password has been provided OR a complete handshake occured and the decrypter is ready for the password

◆ count_all_group_windows()

uint32_t yarilo::WPA2Decrypter::count_all_group_windows ( ) const

◆ decrypt()

bool yarilo::WPA2Decrypter::decrypt ( Tins::Packet * pkt)

Decrypts the given packet

Parameters
[in]pktPointer to the packet to decrypt
Returns
True if decryption was successful, false otherwise

◆ extract_hc22000()

std::optional< std::string > yarilo::WPA2Decrypter::extract_hc22000 ( const client_window & client)

Extracts information needed for cracking the PSK of a WPA2 network for use with hashcat mode 22000

Parameters
[in]windowThe client window for which to extract data
Returns
An optional containing the hc22000 formatted string, see the following for format specification: https://hashcat.net/wiki/doku.php?id=cracking_wpawpa2

◆ get_all_client_windows()

std::optional< std::vector< client_window > > yarilo::WPA2Decrypter::get_all_client_windows ( const MACAddress & client)

Retrieves all client windows for the specified client

Parameters
[in]clientThe MAC address of the client
Returns
An optional containing a vector of client windows if found, otherwise an empty optional

◆ get_all_group_windows()

std::vector< group_window > yarilo::WPA2Decrypter::get_all_group_windows ( ) const

Retrieves all group windows

Returns
A vector of all group windows

◆ get_clients()

std::set< MACAddress > yarilo::WPA2Decrypter::get_clients ( ) const

Retrieves the set of clients connected to the network

Returns
A set of MAC addresses representing the clients

◆ get_current_client_window()

std::optional< client_window > yarilo::WPA2Decrypter::get_current_client_window ( const MACAddress & client)

Retrieves the current client window for the specified client

Parameters
[in]clientThe MAC address of the client
Returns
An optional containing the client window if found, otherwise an empty optional

◆ get_current_group_window()

group_window yarilo::WPA2Decrypter::get_current_group_window ( ) const

Retrieves the current group window

Returns
The current group window

◆ get_password()

std::optional< std::string > yarilo::WPA2Decrypter::get_password ( ) const

Retrieves the current password if available

Returns
An optional containing the password if set, otherwise an empty optional

◆ has_working_password()

bool yarilo::WPA2Decrypter::has_working_password ( ) const

Checks if a working password has been set

Returns
True if password which generated valid keys is available, false otherwise

◆ readable_hex()

std::string yarilo::WPA2Decrypter::readable_hex ( const std::vector< uint8_t > & vec)
static

Makes a byte vector a pretty string like 0x03 0x02 0x01 to "030201"

Returns
string hex representation

The documentation for this class was generated from the following files: