Skip to content

Commit a72a297

Browse files
committed
Fixed bug when selecting monitor
1 parent 7434485 commit a72a297

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

Fern-Wifi-Cracker/core/fern.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -510,12 +510,19 @@ def set_monitor_thread(self, monitor_card, mac_setting_exists, last_settings):
510510
if (monitor_created):
511511
monitor_interface_process = str(subprocess.getoutput("airmon-ng"))
512512

513-
regex = object()
514-
if ('monitor mode enabled' in status):
515-
regex = re.compile("mon\d", re.IGNORECASE)
516513

517-
elif ('monitor mode vif enabled' in status):
518-
regex = re.compile("wlan\dmon", re.IGNORECASE)
514+
regex = re.compile("mon\d", re.IGNORECASE)
515+
interfaces = regex.findall(monitor_interface_process)
516+
517+
if len(interfaces) == 0:
518+
regex = re.compile("wlan\dmon", re.IGNORECASE)
519+
interfaces = regex.findall(monitor_interface_process)
520+
521+
if len(interfaces) == 0:
522+
self.monitor_failed_signal.emit()
523+
return
524+
525+
519526

520527
interfaces = regex.findall(monitor_interface_process)
521528
if (interfaces):

0 commit comments

Comments
 (0)