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

Function download_file_api

webapp_modern.py:16158–16216  ·  view source on GitHub ↗

Download a file

()

Source from the content-addressed store, hash-verified

16156 bssid_match = _re.match(r'^([0-9A-Fa-f]{2}\\:[0-9A-Fa-f]{2}\\:[0-9A-Fa-f]{2}\\:[0-9A-Fa-f]{2}\\:[0-9A-Fa-f]{2}\\:[0-9A-Fa-f]{2})', raw)
16157 if not bssid_match:
16158 continue
16159 bssid = bssid_match.group(1).replace('\\:', ':').upper()
16160 remainder = raw[bssid_match.end():]
16161 if remainder.startswith(':'):
16162 remainder = remainder[1:]
16163 rparts = remainder.split(':')
16164 if len(rparts) < 4:
16165 continue
16166 ssid = rparts[0] if rparts[0] else '(Hidden)'
16167 signal = rparts[1] if len(rparts) > 1 else '0'
16168 security = rparts[2] if len(rparts) > 2 else ''
16169 freq = rparts[3] if len(rparts) > 3 else ''
16170
16171 # 1. Evil twin detection — same SSID as ours, different BSSID
16172 if own_ssid and ssid == own_ssid and bssid != own_bssid and own_bssid:
16173 key = f'evil_twin_{bssid}'
16174 if key not in seen:
16175 seen.add(key)
16176 findings.append({
16177 'type': 'Evil Twin',
16178 'severity': 'critical',
16179 'ssid': ssid,
16180 'bssid': bssid,
16181 'signal': signal,
16182 'description': f'AP impersonating your network "{ssid}" with different BSSID {bssid}'
16183 })
16184
16185 # 2. Rogue SSID patterns
16186 for pattern, name, severity, desc in _ROGUE_SSID_PATTERNS:
16187 if pattern.search(ssid):
16188 key = f'rogue_{name}_{bssid}'
16189 if key not in seen:
16190 seen.add(key)
16191 findings.append({
16192 'type': name,
16193 'severity': severity,
16194 'ssid': ssid,
16195 'bssid': bssid,
16196 'signal': signal,
16197 'description': desc
16198 })
16199 break
16200
16201 # 3. Suspicious OUI (ESP32/Pi broadcasting as AP)
16202 oui = bssid[:8]
16203 if oui in _SUSPICIOUS_AP_OUIS:
16204 vendor = _SUSPICIOUS_AP_OUIS[oui]
16205 key = f'sus_oui_{bssid}'
16206 if key not in seen:
16207 seen.add(key)
16208 findings.append({
16209 'type': f'Suspicious {vendor} AP',
16210 'severity': 'low',
16211 'ssid': ssid,
16212 'bssid': bssid,
16213 'signal': signal,
16214 'description': f'{vendor} device broadcasting as access point — may be rogue'
16215 })

Callers

nothing calls this directly

Calls 4

_resolve_loot_pathFunction · 0.85
_resolve_legacy_pathFunction · 0.85
errorMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected