Filter real-time logs to focus on security scanning activities
(log_line)
| 14642 | r = subprocess.run( |
| 14643 | ['sudo', 'iw', 'dev', iface, 'interface', 'add', |
| 14644 | _mon, 'type', 'monitor'], |
| 14645 | capture_output=True, timeout=5 |
| 14646 | ) |
| 14647 | if r.returncode == 0: |
| 14648 | subprocess.run(['sudo', 'ip', 'link', 'set', _mon, 'up'], |
| 14649 | capture_output=True, timeout=5) |
| 14650 | capture_iface = _mon |
| 14651 | _monitor_mode_used[0] = True |
| 14652 | |
| 14653 | if not capture_iface: |
| 14654 | # Final fallback: iw event — only sees deauth on own connection |
| 14655 | proc = subprocess.Popen( |
| 14656 | ['sudo', 'iw', 'event', '-t'], |
| 14657 | stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True |
| 14658 | ) |
| 14659 | _time.sleep(3) |
| 14660 | proc.terminate() |
| 14661 | for line in (proc.stdout.read() or '').splitlines(): |
| 14662 | if any(k in line.lower() for k in ['deauth', 'disassoc']): |
| 14663 | deauth_events.append(line.strip()) |
| 14664 | return |
| 14665 | |
| 14666 | # --- Hop channels and capture deauth frames --- |
| 14667 | for ch in channels: |
| 14668 | subprocess.run( |
| 14669 | ['sudo', 'iw', 'dev', capture_iface, 'set', 'channel', str(ch)], |
| 14670 | capture_output=True, timeout=3 |
| 14671 | ) |
| 14672 | proc = subprocess.Popen( |
| 14673 | ['sudo', 'tcpdump', '-i', capture_iface, '-c', '100', |
| 14674 | '-n', '-l', |
| 14675 | 'type mgt subtype deauth or type mgt subtype disassoc'], |
| 14676 | stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True |
| 14677 | ) |