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

Function wardriving_bluetooth

webapp_modern.py:8446–8461  ·  view source on GitHub ↗

Get discovered Bluetooth devices.

()

Source from the content-addressed store, hash-verified

8444 iface_addrs = netifaces.ifaddresses(gw_tuple[1]).get(netifaces.AF_INET)
8445 if iface_addrs:
8446 my_ip = iface_addrs[0]['addr']
8447 mask = iface_addrs[0]['netmask']
8448 cidr_bits = sum(bin(int(x)).count('1') for x in mask.split('.'))
8449 primary = str(_ip.ip_network(f"{my_ip}/{cidr_bits}", strict=False))
8450 except Exception:
8451 pass
8452
8453 if request.method == 'GET':
8454 return jsonify({'subnets': subnets, 'primary': primary})
8455
8456 data = request.get_json() or {}
8457 raw = str(data.get('cidr', '')).strip()
8458 if not raw:
8459 return jsonify({'error': 'Missing cidr field'}), 400
8460
8461 # Validate
8462 try:
8463 net = _ip.ip_network(raw, strict=False)
8464 normalised = str(net)

Callers

nothing calls this directly

Calls 4

get_bluetooth_devicesMethod · 0.95
WardrivingSessionClass · 0.90
_get_wardriving_engineFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected