From ac5dea59030c5a7e2a365c56fd7447288836eb95 Mon Sep 17 00:00:00 2001 From: Mathy Vanhoef Date: Sat, 19 Dec 2020 04:47:04 +0400 Subject: [PATCH] fragattack: check hostap and driver for version 1.3 --- hostapd/ctrl_iface.c | 2 +- research/fraginternals.py | 8 +++++++- wpa_supplicant/ctrl_iface.c | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c index 85c15c5c2..75db754bb 100644 --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c @@ -79,7 +79,7 @@ #define HOSTAPD_GLOBAL_CTRL_IFACE_PORT_LIMIT 50 #endif /* CONFIG_CTRL_IFACE_UDP */ -const char *FRAGATTACK_VERSION = "1.2"; +const char *FRAGATTACK_VERSION = "1.3"; static void hostapd_ctrl_iface_send(struct hostapd_data *hapd, int level, enum wpa_msg_type type, diff --git a/research/fraginternals.py b/research/fraginternals.py index 949d0ded9..aee8a491f 100644 --- a/research/fraginternals.py +++ b/research/fraginternals.py @@ -11,7 +11,7 @@ from wpaspy import Ctrl from scapy.contrib.wpa_eapol import WPA_key from scapy.arch.common import get_if_raw_hwaddr -FRAGVERSION = "1.2" +FRAGVERSION = "1.3" # ----------------------------------- Utility Commands ----------------------------------- @@ -730,6 +730,12 @@ class Daemon(metaclass=abc.ABCMeta): log(STATUS, "To ignore this warning and timeout add the parameter --no-drivercheck") time.sleep(5) + version = open("/sys/module/mac80211/parameters/fragattack_version").read().strip() + if version != FRAGVERSION: + log(ERROR, f"This script has version {FRAGVERSION} but the modified drivers are version {version}.") + log(ERROR, f"Please recompile and reinstall the modified drivers (see the README for details).") + quit(1) + # 1. Assign/create interfaces according to provided options if self.options.hwsim: # TODO: Automatically create both interfaces? diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c index 428bddef0..866a924b5 100644 --- a/wpa_supplicant/ctrl_iface.c +++ b/wpa_supplicant/ctrl_iface.c @@ -68,7 +68,7 @@ #include #endif -const char *FRAGATTACK_VERSION = "1.2"; +const char *FRAGATTACK_VERSION = "1.3"; static int wpa_supplicant_global_iface_list(struct wpa_global *global, char *buf, int len);