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

Function delete_file_api

webapp_modern.py:16220–16285  ·  view source on GitHub ↗

Delete a file or directory

()

Source from the content-addressed store, hash-verified

16218 'ssid': ssid,
16219 'bssid': bssid,
16220 'signal': signal,
16221 'description': f'Open network "{ssid}" — possible honeypot or evil twin'
16222 })
16223
16224 # 5. Beacon spam detection — many SSIDs from same Espressif OUI
16225 oui_ssid_count = {}
16226 for line in result.stdout.strip().split('\n'):
16227 if not line.strip():
16228 continue
16229 bm = _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})', line)
16230 if not bm:
16231 continue
16232 b_oui = bm.group(1).replace('\\:', ':').upper()[:8]
16233 if b_oui in _SUSPICIOUS_AP_OUIS:
16234 oui_ssid_count.setdefault(b_oui, set())
16235 # Extract SSID
16236 rem = line[bm.end():]
16237 if rem.startswith(':'):
16238 rem = rem[1:]
16239 s_parts = rem.split(':')
16240 s_ssid = s_parts[0] if s_parts else ''
16241 if s_ssid:
16242 oui_ssid_count[b_oui].add(s_ssid)
16243
16244 for oui_prefix, ssid_set in oui_ssid_count.items():
16245 if len(ssid_set) >= 5:
16246 vendor = _SUSPICIOUS_AP_OUIS.get(oui_prefix, 'Unknown')
16247 key = f'beacon_spam_{oui_prefix}'
16248 if key not in seen:
16249 seen.add(key)
16250 findings.append({
16251 'type': 'Beacon Spam Attack',
16252 'severity': 'high',
16253 'ssid': f'{len(ssid_set)} fake SSIDs',
16254 'bssid': f'{oui_prefix}:*',
16255 'signal': '-',
16256 'description': f'{len(ssid_set)} different SSIDs from {vendor} OUI {oui_prefix} — likely beacon spam from a deauther/Marauder'
16257 })
16258
16259 # 6. Deauth detection from monitor-mode capture (channels 1/6/11)
16260 ev_thread.join(timeout=5)
16261 if deauth_events:
16262 findings.append({
16263 'type': 'Deauth Attack Detected',
16264 'severity': 'critical',
16265 'ssid': '(airspace)',
16266 'bssid': '-',
16267 'signal': '-',
16268 'description': f'{len(deauth_events)} deauth/disassoc frame(s) captured across ch 1/6/11 — active WiFi attack in progress'
16269 })
16270
16271 # Sort by severity
16272 sev_order = {'critical': 0, 'high': 1, 'medium': 2, 'low': 3}
16273 findings.sort(key=lambda f: sev_order.get(f['severity'], 4))
16274
16275 return jsonify({
16276 'success': True,
16277 'findings': findings,

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected