From 80ffa3d1d7bed0ff6cd55dbebf7a7a39702e9d2e Mon Sep 17 00:00:00 2001 From: ahmed-alnassif Date: Sun, 15 Feb 2026 21:25:58 +0300 Subject: [PATCH 1/3] feat(args.py): add --random-mac-vendor to not change the vendor bytes and -mac/--random-mac for full random mac --- wifite/args.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wifite/args.py b/wifite/args.py index a76f75bce..1718843a7 100755 --- a/wifite/args.py +++ b/wifite/args.py @@ -297,7 +297,12 @@ def _add_global_args(self, glob): '--random-mac', action='store_true', dest='random_mac', - help=Color.s('Randomize wireless card MAC address (default: {G}off{W})')) + help=Color.s('Randomize wireless card MAC address completely (better privacy) (default: {G}off{W})')) + + glob.add_argument('--random-mac-vendor', + action='store_true', + dest='random_mac_vendor', + help=Color.s('Randomize wireless card MAC address but keep vendor bytes (better compatibility) (default: {G}off{W})')) glob.add_argument('-p', action='store', From 68d238cb725fd8e06b6581e5e041db3ea17b4c42 Mon Sep 17 00:00:00 2001 From: ahmed-alnassif Date: Sun, 15 Feb 2026 21:26:19 +0300 Subject: [PATCH 2/3] refactor:(config.py): add random mac logic --- wifite/config.py | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/wifite/config.py b/wifite/config.py index 930e39886..9fc8448e8 100755 --- a/wifite/config.py +++ b/wifite/config.py @@ -41,6 +41,7 @@ class Configuration(object): pmkid_timeout = None print_stack_traces = None random_mac = None + random_mac_vendor = None require_fakeauth = None scan_time = None show_bssids = None @@ -326,8 +327,8 @@ def get_monitor_mode_interface(cls): # Interface wasn't defined, select it! from .tools.airmon import Airmon cls.interface = Airmon.ask() - if cls.random_mac: - Macchanger.random() + if cls.random_mac or cls.random_mac_vendor: + Macchanger.random(full_random=not cls.random_mac_vendor) @classmethod def load_from_arguments(cls): @@ -578,9 +579,22 @@ def _validate_wpasec_config(cls): def parse_settings_args(cls, args): """Parses basic settings/configurations from arguments.""" - if args.random_mac: - cls.random_mac = True - Color.pl('{+} {C}option:{W} using {G}random mac address{W} when scanning & attacking') + if args.random_mac or args.random_mac_vendor: + if args.random_mac and args.random_mac_vendor: + Color.pl('{!} {O}Warning: Cannot use both --random-mac and --random-mac-vendor') + Color.pl('{+} {W}Falling back to {C}--random-mac{W} (full random) for better privacy') + args.random_mac_vendor = False + + if args.random_mac: + cls.random_mac = True + cls.random_mac_vendor = False + mode_str = "full random (maximum privacy)" + else: + cls.random_mac_vendor = True + cls.random_mac = False + mode_str = "vendor-preserved (better compatibility)" + + Color.pl('{+} {C}option:{W} using {G}random MAC address{W} ({C}%s{W}) when scanning & attacking' % mode_str) if args.channel: chn_arg_re = re.compile(r"^\d+((,\d+)|(-\d+,\d+))*(-\d+)?$") From dc165bf4bd9c6d0a050a86cf935c6000e50fb19d Mon Sep 17 00:00:00 2001 From: ahmed-alnassif Date: Sun, 15 Feb 2026 21:26:43 +0300 Subject: [PATCH 3/3] feat(macchanger.py): the user can now choose between -e/-r for better privacy --- wifite/tools/macchanger.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/wifite/tools/macchanger.py b/wifite/tools/macchanger.py index 33b63649b..46d97829c 100755 --- a/wifite/tools/macchanger.py +++ b/wifite/tools/macchanger.py @@ -61,7 +61,7 @@ def reset(cls): Color.pl('\r{+} {C}macchanger{W}: reset mac address back to {C}%s{W} on {C}%s{W}' % (new_mac, iface)) @classmethod - def random(cls): + def random(cls, full_random=True): from ..util.process import Process if not Process.exists('macchanger'): Color.pl('{!} {R}macchanger: {O}not installed') @@ -72,7 +72,9 @@ def random(cls): # -r to use random MAC address # -e to keep vendor bytes the same - if cls.down_macch_up(iface, ['-e']): + option = "-r" if full_random else "-e" + + if cls.down_macch_up(iface, [option]): cls.is_changed = True new_mac = Ip.get_mac(iface)