Skip to content

A WiFi security auditing software

feat: add PMKID detection, display and cracking support

Martin Olivierd5322f6411a8
diff --git a/README.md b/README.md
index 03d56e2..67ed58a 100644
--- a/README.md
+++ b/README.md
@@ -20,7 +20,7 @@ Airgorah</h1>
[![aur](https://img.shields.io/aur/version/airgorah)](https://aur.archlinux.org/packages/airgorah)
[![ci](https://github.com/martin-olivier/airgorah/actions/workflows/CI.yml/badge.svg)](https://github.com/martin-olivier/airgorah/actions/workflows/CI.yml)
-`Airgorah` is a WiFi security auditing software that can capture nearby WiFi traffic, discover clients connected to access points, perform deauthentication attacks, capture handshakes, and crack the password of access points.
+`Airgorah` is a WiFi security auditing software that can capture nearby WiFi traffic, discover clients connected to access points, perform deauthentication attacks, capture handshakes and PMKIDs, and crack the password of access points.
It is written in Rust and uses [GTK4](https://github.com/gtk-rs/gtk4-rs) for the graphical part.
diff --git a/crates/agent/src/backend/capture.rs b/crates/agent/src/backend/capture.rs
index fb5867a..c459d9f 100644
--- a/crates/agent/src/backend/capture.rs
+++ b/crates/agent/src/backend/capture.rs
@@ -1,11 +1,12 @@
use super::*;
-use airgorah_common::handshake::get_handshakes;
+use airgorah_common::handshake::get_crackables;
use std::io::{Read, Seek, SeekFrom};
use std::path::Path;
-/// Update the handshake capture status of all APs by scanning the live/old
-/// capture files. Runs agent-side because those files are root-owned.
-pub fn update_handshakes() -> std::io::Result<()> {
+/// Update the crackable-material status (4-way handshake and PMKID) of all APs by
+/// scanning the live/old capture files. Runs agent-side because those files are
+/// root-owned.
+pub fn update_crackables() -> std::io::Result<()> {
let paths: Vec<String> = [
get_live_scan_path() + get_cap_ext(),
get_old_scan_path() + get_cap_ext(),
@@ -18,17 +19,18 @@ pub fn update_handshakes() -> std::io::Result<()> {
return Ok(());
}
- let handshakes = get_handshakes(&paths)?;
+ let crackables = get_crackables(&paths)?;
let mut aps = get_aps();
- for (bssid, _) in handshakes {
- if let Some(ap) = aps.get_mut(&bssid) {
- ap.handshake = true;
+ for crackable in crackables {
+ if let Some(ap) = aps.get_mut(&crackable.bssid) {
+ ap.handshake = crackable.handshake;
+ ap.pmkid = crackable.pmkid;
}
}
- log::trace!("handshakes updated");
+ log::trace!("crackable material updated");
Ok(())
}
diff --git a/crates/agent/src/backend/sniffer.rs b/crates/agent/src/backend/sniffer.rs
index 75fff68..ae184f0 100644
--- a/crates/agent/src/backend/sniffer.rs
+++ b/crates/agent/src/backend/sniffer.rs
@@ -287,6 +287,7 @@ fn update_ap(
privacy,
hidden,
handshake: false,
+ pmkid: false,
saved_handshake: None,
first_time_seen: now.clone(),
last_time_seen: now,
diff --git a/crates/agent/src/main.rs b/crates/agent/src/main.rs
index f7677ec..4a39c3b 100644
--- a/crates/agent/src/main.rs
+++ b/crates/agent/src/main.rs
@@ -66,10 +66,10 @@ fn main() {
})
.ok();
- // Handshake detection now lives agent-side (it owns the capture files).
+ // Crackable-material detection (handshake + PMKID)
std::thread::spawn(|| {
loop {
- backend::update_handshakes().ok();
+ backend::update_crackables().ok();
std::thread::sleep(std::time::Duration::from_millis(1500));
}
});
diff --git a/crates/common/src/handshake.rs b/crates/common/src/handshake.rs
index b48d79f..dae198b 100644
--- a/crates/common/src/handshake.rs
+++ b/crates/common/src/handshake.rs
@@ -1,16 +1,20 @@
-//! Native WPA handshake detection.
+//! Native WPA crackable-material detection (4-way handshake and PMKID).
//!
-//! Reads capture file(s) and reports which access points have a crackable WPA 4-way handshake.
-//! Shared because both sides need it against different files: the agent scans the
-//! root-owned live/old captures to flag APs while scanning, and the GUI inspects a
-//! user-selected capture before offering it for decryption. Reading a capture and
-//! parsing it needs no privilege, so the logic is identical on both sides.
+//! Reads capture file(s) and reports which access points have crackable WPA
+//! material — a captured 4-way handshake and/or a PMKID. Shared because both sides
+//! need it against different files: the agent scans the root-owned live/old captures
+//! to flag APs while scanning, and the GUI inspects a user-selected capture before
+//! offering it for decryption. Reading a capture and parsing it needs no
+//! privilege, so the logic is identical on both sides.
//!
//! Only the classic libpcap format is read, with link type
//! `LINKTYPE_IEEE802_11_RADIOTAP` (127, what airgorah itself writes) or plain
//! `LINKTYPE_IEEE802_11` (105). Frames are decoded with `radiotap` + `libwifi`;
//! a data frame carrying an EAPOL key is classified into one of the four handshake
-//! messages, and an AP is reported once a crackable combination has been seen.
+//! messages, and an AP is reported once a crackable combination has been seen. The
+//! same message 1 also carries the AP's PMKID (in the RSN PMKID KDE of the key
+//! data) when the AP volunteers it — a clientless capture that is crackable on its
+//! own, so it is flagged independently of the 4-way handshake.
use std::collections::{HashMap, HashSet};
use std::path::Path;
@@ -23,9 +27,21 @@ use libwifi::frame::components::{DataHeader, ManagementHeader, StationInfo};
const LINKTYPE_IEEE802_11: u32 = 105;
const LINKTYPE_IEEE802_11_RADIOTAP: u32 = 127;
-/// Return `(bssid, essid)` for every AP that has a captured WPA 4-way handshake in
-/// the given capture file(s). Unreadable or unparsable files are skipped.
-pub fn get_handshakes<I, S>(paths: I) -> std::io::Result<Vec<(String, String)>>
+/// Crackable WPA material found for one access point in a capture.
+///
+/// `handshake` and `pmkid` are independent: either alone makes the AP crackable,
+/// and both can be present in the same capture.
+#[derive(Clone, Debug, PartialEq, Eq)]
+pub struct Crackable {
+ pub bssid: String,
+ pub essid: String,
+ pub handshake: bool,
+ pub pmkid: bool,
+}
+
+/// Return a [`Crackable`] for every AP that yielded a WPA 4-way handshake and/or a
+/// PMKID in the given capture file(s). Unreadable or unparsable files are skipped.
+pub fn get_crackables<I, S>(paths: I) -> std::io::Result<Vec<Crackable>>
where
I: IntoIterator<Item = S>,
S: AsRef<Path>,
@@ -33,25 +49,32 @@ where
let mut essids: HashMap<String, String> = HashMap::new();
// Per (bssid, station): a bitmask of which handshake messages M1..M4 were seen.
let mut messages: HashMap<(String, String), u8> = HashMap::new();
+ // BSSIDs whose message 1 carried a valid PMKID.
+ let mut pmkids: HashSet<String> = HashSet::new();
for path in paths {
if let Ok(data) = std::fs::read(path.as_ref()) {
- scan_capture(&data, &mut essids, &mut messages);
+ scan_capture(&data, &mut essids, &mut messages, &mut pmkids);
}
}
// A crackable 4-way handshake needs M2 — the only carrier of the SNonce, plus a
// MIC — together with an ANonce source (M1 or M3).
- let mut bssids: HashSet<String> = HashSet::new();
+ let mut handshakes: HashSet<String> = HashSet::new();
for ((bssid, _station), seen) in &messages {
let m1 = seen & 0b0001 != 0;
let m2 = seen & 0b0010 != 0;
let m3 = seen & 0b0100 != 0;
if m2 && (m1 || m3) {
- bssids.insert(bssid.clone());
+ handshakes.insert(bssid.clone());
}
}
+ // Report every AP that produced either kind of material.
+ let mut bssids: HashSet<String> = HashSet::new();
+ bssids.extend(handshakes.iter().cloned());
+ bssids.extend(pmkids.iter().cloned());
+
Ok(bssids
.into_iter()
.map(|bssid| {
@@ -59,16 +82,40 @@ where
.get(&bssid)
.cloned()
.unwrap_or_else(|| "hidden".to_string());
- (bssid, essid)
+ let handshake = handshakes.contains(&bssid);
+ let pmkid = pmkids.contains(&bssid);
+ Crackable {
+ bssid,
+ essid,
+ handshake,
+ pmkid,
+ }
})
.collect())
}
-/// Walk a single capture's frames, accumulating ESSIDs and handshake messages.
+/// Return `(bssid, essid)` for every AP that has a captured WPA 4-way handshake in
+/// the given capture file(s), ignoring PMKID-only APs. A thin view over
+/// [`get_crackables`] for callers that only care about full handshakes.
+pub fn get_handshakes<I, S>(paths: I) -> std::io::Result<Vec<(String, String)>>
+where
+ I: IntoIterator<Item = S>,
+ S: AsRef<Path>,
+{
+ Ok(get_crackables(paths)?
+ .into_iter()
+ .filter(|crackable| crackable.handshake)
+ .map(|crackable| (crackable.bssid, crackable.essid))
+ .collect())
+}
+
+/// Walk a single capture's frames, accumulating ESSIDs, handshake messages, and
+/// the BSSIDs that leaked a PMKID.
fn scan_capture(
data: &[u8],
essids: &mut HashMap<String, String>,
messages: &mut HashMap<(String, String), u8>,
+ pmkids: &mut HashSet<String>,
) {
let Some(mut reader) = PcapReader::new(data) else {
return;
@@ -105,8 +152,8 @@ fn scan_capture(
match frame {
Frame::Beacon(beacon) => record_essid(&beacon.header, &beacon.station_info, essids),
Frame::ProbeResponse(resp) => record_essid(&resp.header, &resp.station_info, essids),
- Frame::Data(data) => record_eapol(&data.header, &data.eapol_key, messages),
- Frame::QosData(data) => record_eapol(&data.header, &data.eapol_key, messages),
+ Frame::Data(data) => record_eapol(&data.header, &data.eapol_key, messages, pmkids),
+ Frame::QosData(data) => record_eapol(&data.header, &data.eapol_key, messages, pmkids),
_ => {}
}
}
@@ -129,11 +176,13 @@ fn record_essid(
}
}
-/// Classify an EAPOL data frame and record which handshake message it is.
+/// Classify an EAPOL data frame, record which handshake message it is, and note
+/// the AP's PMKID when message 1 carries one.
fn record_eapol(
header: &DataHeader,
eapol: &Option<EapolKey>,
messages: &mut HashMap<(String, String), u8>,
+ pmkids: &mut HashSet<String>,
) {
let Some(key) = eapol else {
return;
@@ -152,7 +201,17 @@ fn record_eapol(
return;
};
- let pair = (bssid.to_long_string(), station.to_long_string());
+ let bssid = bssid.to_long_string();
+
+ // Message 1 optionally advertises the AP's PMKID in the RSN PMKID KDE of its
+ // key data. libwifi validates the KDE (OUI 00:0f:ac, type 4, non-zero PMKID)
+ // and only returns it for message 1, so its presence alone flags the AP as
+ // crackable — no client and no full handshake required.
+ if key.pmkid().is_some() {
+ pmkids.insert(bssid.clone());
+ }
+
+ let pair = (bssid, station.to_long_string());
*messages.entry(pair).or_insert(0) |= 1 << (message - 1);
}
@@ -279,6 +338,118 @@ mod tests {
data.extend_from_slice(payload);
}
+ /// Build an 802.11 Data frame (from-DS) carrying an EAPOL-Key message 1, with
+ /// an optional RSN PMKID KDE in its key data. `bssid`/`station` are the AP and
+ /// client MACs; the AP is the transmitter (address 2) on this downlink frame.
+ fn eapol_m1_frame(bssid: [u8; 6], station: [u8; 6], pmkid: Option<[u8; 16]>) -> Vec<u8> {
+ let mut frame = Vec::new();
+
+ // 802.11 MAC header (24 bytes): a from-DS data frame, so address 1 is the
+ // destination station and address 2 is the transmitting AP (the BSSID).
+ frame.extend_from_slice(&[0x08, 0x02]); // frame control: Data, subtype 0, from_ds
+ frame.extend_from_slice(&[0x00, 0x00]); // duration
+ frame.extend_from_slice(&station); // address 1 (RA): destination station
+ frame.extend_from_slice(&bssid); // address 2 (TA): transmitting AP
+ frame.extend_from_slice(&bssid); // address 3: BSSID
+ frame.extend_from_slice(&[0x00, 0x00]); // sequence control
+
+ // LLC/SNAP header announcing EAPOL (ethertype 0x888e).
+ frame.extend_from_slice(&[0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00, 0x88, 0x8e]);
+
+ // Key data: an RSN PMKID KDE when a PMKID is provided, otherwise empty.
+ let key_data = match pmkid {
+ Some(pmkid) => {
+ let mut kde = vec![0xdd, 0x14, 0x00, 0x0f, 0xac, 0x04]; // id, len, OUI, type 4
+ kde.extend_from_slice(&pmkid);
+ kde
+ }
+ None => Vec::new(),
+ };
+
+ // EAPOL-Key body (message 1: pairwise Key Type + Key ACK, no MIC).
+ let mut eapol = Vec::new();
+ eapol.push(0x02); // protocol version
+ eapol.push(0x03); // packet type: EAPOL-Key
+ eapol.extend_from_slice(&(95 + key_data.len() as u16).to_be_bytes()); // packet length
+ eapol.push(0x02); // descriptor type: RSN
+ eapol.extend_from_slice(&0x008au16.to_be_bytes()); // key information: message 1
+ eapol.extend_from_slice(&0x0010u16.to_be_bytes()); // key length
+ eapol.extend_from_slice(&1u64.to_be_bytes()); // replay counter
+ eapol.extend_from_slice(&[0x11; 32]); // key nonce (ANonce)
+ eapol.extend_from_slice(&[0x00; 16]); // key iv
+ eapol.extend_from_slice(&0u64.to_be_bytes()); // key rsc
+ eapol.extend_from_slice(&0u64.to_be_bytes()); // key id
+ eapol.extend_from_slice(&[0x00; 16]); // key mic (absent in message 1)
+ eapol.extend_from_slice(&(key_data.len() as u16).to_be_bytes()); // key data length
+ eapol.extend_from_slice(&key_data);
+
+ frame.extend_from_slice(&eapol);
+ frame
+ }
+
+ #[test]
+ fn detects_pmkid_in_message_one() {
+ let bssid = [0x18, 0x86, 0x37, 0x1f, 0x30, 0x40];
+ let station = [0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff];
+
+ let mut essids = HashMap::new();
+ let mut messages = HashMap::new();
+ let mut pmkids = HashSet::new();
+
+ let frame = eapol_m1_frame(bssid, station, Some([0x42; 16]));
+ let mut data = global_header(LINKTYPE_IEEE802_11);
+ push_record(&mut data, &frame);
+
+ scan_capture(&data, &mut essids, &mut messages, &mut pmkids);
+
+ // The AP's PMKID is recorded, and no full handshake is claimed from M1 alone.
+ assert_eq!(pmkids.len(), 1);
+ assert_eq!(messages.values().copied().collect::<Vec<_>>(), vec![0b0001]);
+ }
+
+ #[test]
+ fn message_one_without_pmkid_is_not_flagged() {
+ let bssid = [0x18, 0x86, 0x37, 0x1f, 0x30, 0x40];
+ let station = [0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff];
+
+ let mut essids = HashMap::new();
+ let mut messages = HashMap::new();
+ let mut pmkids = HashSet::new();
+
+ // A message 1 whose key data has no PMKID KDE (empty key data).
+ let frame = eapol_m1_frame(bssid, station, None);
+ let mut data = global_header(LINKTYPE_IEEE802_11);
+ push_record(&mut data, &frame);
+
+ scan_capture(&data, &mut essids, &mut messages, &mut pmkids);
+
+ assert!(pmkids.is_empty());
+ }
+
+ #[test]
+ fn get_crackables_reports_a_pmkid_only_ap() {
+ let bssid = [0x18, 0x86, 0x37, 0x1f, 0x30, 0x40];
+ let station = [0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff];
+
+ let mut data = global_header(LINKTYPE_IEEE802_11);
+ push_record(&mut data, &eapol_m1_frame(bssid, station, Some([0x42; 16])));
+
+ let mut path = std::env::temp_dir();
+ path.push(format!("airgorah-pmkid-test-{}.cap", std::process::id()));
+ std::fs::write(&path, &data).unwrap();
+
+ let crackables = get_crackables([&path]).unwrap();
+ std::fs::remove_file(&path).ok();
+
+ // A lone PMKID makes the AP crackable even though there is no 4-way handshake.
+ assert_eq!(crackables.len(), 1);
+ assert!(crackables[0].pmkid);
+ assert!(!crackables[0].handshake);
+ // get_handshakes, which reports only 4-way handshakes, ignores it.
+ let handshakes = get_handshakes([&path]).unwrap_or_default();
+ assert!(handshakes.is_empty());
+ }
+
fn global_header(link_type: u32) -> Vec<u8> {
let mut header = Vec::new();
header.extend_from_slice(&0xa1b2_c3d4u32.to_le_bytes()); // magic (little-endian)
diff --git a/crates/common/src/types.rs b/crates/common/src/types.rs
index f2aaa36..26d5de5 100644
--- a/crates/common/src/types.rs
+++ b/crates/common/src/types.rs
@@ -53,9 +53,10 @@ pub struct AP {
pub privacy: String,
pub hidden: bool,
pub handshake: bool,
- /// Path of a capture file the *GUI* saved this handshake to. This is GUI-side
- /// overlay state: the agent always leaves it `None` and the GUI fills it in
- /// from its own bookkeeping before display.
+ pub pmkid: bool,
+ /// Path of a capture file the *GUI* saved this AP's crackable material to. This
+ /// is GUI-side overlay state: the agent always leaves it `None` and the GUI
+ /// fills it in from its own bookkeeping before display.
pub saved_handshake: Option<String>,
pub first_time_seen: String,
pub last_time_seen: String,
diff --git a/crates/gui/src/backend/client.rs b/crates/gui/src/backend/client.rs
index 4f2f6bd..37810f7 100644
--- a/crates/gui/src/backend/client.rs
+++ b/crates/gui/src/backend/client.rs
@@ -386,15 +386,15 @@ pub fn get_attack_pool() -> MutexGuard<'static, HashMap<String, AttackState>> {
ATTACK_POOL.lock().unwrap()
}
-/// Record that every currently-captured handshake has been saved to `path`.
-/// Replaces the old direct mutation of the AP map so the mark survives the next
-/// snapshot refresh (it is stored in the GUI-side overlay).
-pub fn mark_handshakes_saved(path: &str) {
+/// Record that every AP with currently-captured crackable material (a handshake
+/// or a PMKID) has been saved to `path`. Stored in the GUI-side overlay so the
+/// mark survives the next snapshot refresh.
+pub fn mark_crackables_saved(path: &str) {
let mut overlay = SAVED_HANDSHAKES.lock().unwrap();
let mut aps = get_aps();
for (bssid, ap) in aps.iter_mut() {
- if ap.handshake {
+ if ap.handshake || ap.pmkid {
overlay.insert(bssid.clone(), path.to_string());
ap.saved_handshake = Some(path.to_string());
}
diff --git a/crates/gui/src/backend/decrypt.rs b/crates/gui/src/backend/decrypt.rs
index fd88e38..d33572c 100755
--- a/crates/gui/src/backend/decrypt.rs
+++ b/crates/gui/src/backend/decrypt.rs
@@ -19,7 +19,7 @@ pub fn run_decrypt_wordlist_process(
essid: &str,
wordlist: &str,
) -> Result<(), DecryptError> {
- let title = format!("Handshake Decryption ({essid})");
+ let title = format!("WPA Decryption ({essid})");
Command::new("xterm")
.stdin(Stdio::null())
@@ -73,7 +73,7 @@ pub fn run_decrypt_bruteforce_process(
}
BruteforceCharset::Specific(custom) => custom.to_owned(),
};
- let title = format!("Handshake Decryption ({essid})");
+ let title = format!("WPA Decryption ({essid})");
let cmd =
format!("crunch {min} {max} '{charset_str}' | aircrack-ng -w - -b '{bssid}' '{handshake}'");
diff --git a/crates/gui/src/backend/mod.rs b/crates/gui/src/backend/mod.rs
index f1a73bb..da9d218 100644
--- a/crates/gui/src/backend/mod.rs
+++ b/crates/gui/src/backend/mod.rs
@@ -15,4 +15,4 @@ pub use settings::*;
pub use airgorah_common::channel::is_valid_channel_filter;
pub use airgorah_common::deps;
-pub use airgorah_common::handshake::get_handshakes;
+pub use airgorah_common::handshake::get_crackables;
diff --git a/crates/gui/src/frontend/connections/app.rs b/crates/gui/src/frontend/connections/app.rs
index 8d3f0cb..1b8f5ed 100755
--- a/crates/gui/src/frontend/connections/app.rs
+++ b/crates/gui/src/frontend/connections/app.rs
@@ -749,7 +749,8 @@ fn start_app_refresh(app_data: Rc<AppData>) {
}
}
- match backend::get_aps()[&bssid].handshake {
+ let ap = &backend::get_aps()[&bssid];
+ match ap.handshake || ap.pmkid {
true => app_data.app_gui.capture_but.set_sensitive(true),
false => app_data.app_gui.capture_but.set_sensitive(false),
}
@@ -801,7 +802,8 @@ fn start_app_refresh(app_data: Rc<AppData>) {
(7, &ap.first_time_seen),
(8, &ap.last_time_seen),
(9, &ap.handshake),
- (10, &background_color.to_str()),
+ (10, &ap.pmkid),
+ (11, &background_color.to_str()),
],
);
}
@@ -986,7 +988,7 @@ fn connect_capture_button(app_data: Rc<AppData>) {
None => return,
};
- if !ap.handshake {
+ if !ap.handshake && !ap.pmkid {
return;
}
@@ -1032,7 +1034,7 @@ fn connect_capture_button(app_data: Rc<AppData>) {
);
}
- backend::mark_handshakes_saved(&path);
+ backend::mark_crackables_saved(&path);
app_data.decrypt_gui.show(Some((path, bssid)));
}
diff --git a/crates/gui/src/frontend/connections/decrypt.rs b/crates/gui/src/frontend/connections/decrypt.rs
index db2be9b..b9cce50 100755
--- a/crates/gui/src/frontend/connections/decrypt.rs
+++ b/crates/gui/src/frontend/connections/decrypt.rs
@@ -105,29 +105,31 @@ fn connect_handshake_button(app_data: Rc<AppData>) {
let gio_path = gio_file.path().unwrap();
let file_path = gio_path.to_str().unwrap();
- let handshakes = backend::get_handshakes([file_path]).unwrap_or_default();
+ let crackables = backend::get_crackables([file_path]).unwrap_or_default();
- if handshakes.is_empty() {
+ if crackables.is_empty() {
return ErrorDialog::spawn(
&app_data.decrypt_gui.window,
"Invalid capture",
- &format!("\"{file_path}\" doesn't contain any valid handshake"),
+ &format!(
+ "\"{file_path}\" doesn't contain any valid handshake or PMKID"
+ ),
);
}
app_data.decrypt_gui.target_model.clear();
- for (bssid, essid) in handshakes.iter() {
- app_data
- .decrypt_gui
- .target_model
- .insert_with_values(None, &[(0, &bssid), (1, &essid)]);
+ for crackable in crackables.iter() {
+ app_data.decrypt_gui.target_model.insert_with_values(
+ None,
+ &[(0, &crackable.bssid), (1, &crackable.essid)],
+ );
}
app_data
.decrypt_gui
.target_view
- .set_active(if !handshakes.is_empty() {
+ .set_active(if !crackables.is_empty() {
Some(0)
} else {
None
diff --git a/crates/gui/src/frontend/connections/scan.rs b/crates/gui/src/frontend/connections/scan.rs
index 42a5b5d..ab2b79d 100644
--- a/crates/gui/src/frontend/connections/scan.rs
+++ b/crates/gui/src/frontend/connections/scan.rs
@@ -131,7 +131,7 @@ fn connect_export_button(app_data: Rc<AppData>) {
);
}
- backend::mark_handshakes_saved(&path);
+ backend::mark_crackables_saved(&path);
}
if was_scanning {
diff --git a/crates/gui/src/frontend/interfaces/app.rs b/crates/gui/src/frontend/interfaces/app.rs
index 8d925c5..3a42ce1 100755
--- a/crates/gui/src/frontend/interfaces/app.rs
+++ b/crates/gui/src/frontend/interfaces/app.rs
@@ -20,7 +20,7 @@ fn build_update_button() -> Button {
fn build_decrypt_button() -> Button {
Button::builder()
.icon_name("utilities-terminal-symbolic")
- .tooltip_text("Handshake decryption")
+ .tooltip_text("WPA decryption")
.build()
}
@@ -129,7 +129,7 @@ fn build_deauth_button() -> Button {
fn build_capture_button() -> Button {
Button::builder()
.icon_name("dialog-password-symbolic")
- .tooltip_text("Decrypt a handshake captured on the selected access point")
+ .tooltip_text("Decrypt a handshake or PMKID captured on the selected access point")
.sensitive(false)
.build()
}
@@ -163,6 +163,7 @@ fn build_aps_model() -> ListStore {
glib::Type::STRING, // First time seen
glib::Type::STRING, // Last time seen
glib::Type::BOOL, // Handshake
+ glib::Type::BOOL, // PMKID
glib::Type::STRING, // <color>
])
}
@@ -180,8 +181,12 @@ fn build_aps_view() -> TreeView {
("First time seen", 150),
("Last time seen", 150),
("Handshake", 106),
+ ("PMKID", 80),
];
+ // Index of the hidden per-row background-color column (last model column).
+ const COLOR_COL: i32 = 11;
+
for (pos, (column_name, column_size)) in columns.into_iter().enumerate() {
let column = TreeViewColumn::builder()
.title(column_name)
@@ -198,21 +203,22 @@ fn build_aps_view() -> TreeView {
icon_renderer.set_property("icon-name", "network-wireless");
column.pack_start(&icon_renderer, false);
- column.add_attribute(&icon_renderer, "cell-background", 10);
+ column.add_attribute(&icon_renderer, "cell-background", COLOR_COL);
column.set_expand(true);
}
- if pos == 9 {
+ // The Handshake (9) and PMKID (10) columns render as read-only toggles.
+ if pos == 9 || pos == 10 {
let toggle = CellRendererToggle::new();
toggle.set_sensitive(false);
column.pack_start(&toggle, false);
- column.add_attribute(&toggle, "active", 9);
- column.add_attribute(&toggle, "cell-background", 10);
+ column.add_attribute(&toggle, "active", pos as i32);
+ column.add_attribute(&toggle, "cell-background", COLOR_COL);
} else {
let text_renderer = CellRendererText::new();
column.pack_start(&text_renderer, false);
column.add_attribute(&text_renderer, "text", pos as i32);
- column.add_attribute(&text_renderer, "background", 10);
+ column.add_attribute(&text_renderer, "background", COLOR_COL);
}
view.append_column(&column);
diff --git a/crates/gui/src/frontend/interfaces/decrypt.rs b/crates/gui/src/frontend/interfaces/decrypt.rs
index 791739c..48d2f7e 100644
--- a/crates/gui/src/frontend/interfaces/decrypt.rs
+++ b/crates/gui/src/frontend/interfaces/decrypt.rs
@@ -119,7 +119,7 @@ pub struct DecryptGui {
impl DecryptGui {
pub fn new(parent: &impl IsA<Window>) -> Self {
let window = Window::builder()
- .title("Decrypt Handshake")
+ .title("WPA Decryption")
.hide_on_close(true)
.default_width(440)
.default_height(200)
@@ -276,20 +276,20 @@ impl DecryptGui {
if let Some((path, bssid)) = capture_and_bssid {
self.handshake_entry.set_text(&path);
- let handshakes = backend::get_handshakes([&path]).unwrap_or_default();
+ let crackables = backend::get_crackables([&path]).unwrap_or_default();
- if handshakes.is_empty() {
+ if crackables.is_empty() {
return ErrorDialog::spawn(
&self.window,
"Invalid capture",
- &format!("\"{path}\" doesn't contain any valid handshake"),
+ &format!("\"{path}\" doesn't contain any valid handshake or PMKID"),
);
}
- for (hs_bssid, hs_essid) in handshakes.iter() {
- if hs_bssid == &bssid {
+ for crackable in crackables.iter() {
+ if crackable.bssid == bssid {
self.target_model
- .insert_with_values(None, &[(0, &hs_bssid), (1, &hs_essid)]);
+ .insert_with_values(None, &[(0, &crackable.bssid), (1, &crackable.essid)]);
}
}