MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / get_current_status

Function get_current_status

webapp_modern.py:14588–14635  ·  view source on GitHub ↗

Get current status data

()

Source from the content-addressed store, hash-verified

14586 cur = ln.split()[1]
14587 # 'ragmon0' is WiFi Defense's monitor vif — don't grab or
14588 # reset it, that kills its capture with ENODEV.
14589 if cur != iface and cur != _mon and cur != 'ragmon0':
14590 secondary = cur
14591
14592 if secondary:
14593 # Put secondary adapter directly into monitor mode
14594 subprocess.run(['sudo', 'ip', 'link', 'set', secondary, 'down'],
14595 capture_output=True, timeout=3)
14596 r = subprocess.run(
14597 ['sudo', 'iw', 'dev', secondary, 'set', 'type', 'monitor'],
14598 capture_output=True, timeout=5
14599 )
14600 if r.returncode == 0:
14601 subprocess.run(['sudo', 'ip', 'link', 'set', secondary, 'up'],
14602 capture_output=True, timeout=3)
14603 capture_iface = secondary
14604 restore_secondary = secondary
14605 _monitor_mode_used[0] = True
14606
14607 if not capture_iface:
14608 # Try virtual monitor on primary (won't work on Broadcom)
14609 subprocess.run(['sudo', 'iw', 'dev', _mon, 'del'],
14610 capture_output=True, timeout=3)
14611 r = subprocess.run(
14612 ['sudo', 'iw', 'dev', iface, 'interface', 'add',
14613 _mon, 'type', 'monitor'],
14614 capture_output=True, timeout=5
14615 )
14616 if r.returncode == 0:
14617 subprocess.run(['sudo', 'ip', 'link', 'set', _mon, 'up'],
14618 capture_output=True, timeout=5)
14619 capture_iface = _mon
14620 _monitor_mode_used[0] = True
14621
14622 if not capture_iface:
14623 # Final fallback: iw event — only sees deauth on own connection
14624 proc = subprocess.Popen(
14625 ['sudo', 'iw', 'event', '-t'],
14626 stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True
14627 )
14628 _time.sleep(3)
14629 proc.terminate()
14630 for line in (proc.stdout.read() or '').splitlines():
14631 if any(k in line.lower() for k in ['deauth', 'disassoc']):
14632 deauth_events.append(line.strip())
14633 return
14634
14635 # --- Hop channels and capture deauth frames ---
14636 for ch in channels:
14637 subprocess.run(
14638 ['sudo', 'iw', 'dev', capture_iface, 'set', 'channel', str(ch)],

Callers 4

broadcast_status_updateFunction · 0.85
handle_connectFunction · 0.85
handle_status_requestFunction · 0.85
broadcast_status_updatesFunction · 0.85

Calls 12

is_ethernet_availableFunction · 0.90
safe_strFunction · 0.85
is_orchestrator_runningFunction · 0.85
safe_intFunction · 0.85
safe_boolFunction · 0.85
_get_active_ethernet_ipFunction · 0.85
update_statsMethod · 0.80
debugMethod · 0.80
get_statusMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected