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

Function get_ai_weakness_analysis

webapp_modern.py:19175–19213  ·  view source on GitHub ↗

Get AI-identified network weaknesses

()

Source from the content-addressed store, hash-verified

19173 'success': True,
19174 'message': f'Files cleared successfully ({clear_type} clear, {removed} entries)'
19175 })
19176
19177 except Exception as e:
19178 logger.error(f"Error clearing files: {e}")
19179 return jsonify({'error': str(e)}), 500
19180
19181# Legacy endpoint compatibility
19182@app.route('/list_files')
19183def legacy_list_files():
19184 """Legacy endpoint for file listing"""
19185 try:
19186 path = request.args.get('path', '/')
19187
19188 # Use the same logic as list_files_api but return legacy format
19189 if path == '/' or path == '':
19190 return jsonify([
19191 {'name': 'data_stolen', 'is_directory': True, 'children': []},
19192 {'name': 'scan_results', 'is_directory': True, 'children': []},
19193 {'name': 'crackedpwd', 'is_directory': True, 'children': []},
19194 {'name': 'vulnerabilities', 'is_directory': True, 'children': []},
19195 {'name': 'logs', 'is_directory': True, 'children': []},
19196 {'name': 'backups', 'is_directory': True, 'children': []},
19197 {'name': 'uploads', 'is_directory': True, 'children': []}
19198 ])
19199
19200 # For other paths, use the web_utils function
19201 actual_path = ""
19202 if path.startswith('/data_stolen'):
19203 actual_path = shared_data.datastolendir
19204 elif path.startswith('/scan_results'):
19205 actual_path = shared_data.scan_results_dir
19206 elif path.startswith('/crackedpwd'):
19207 actual_path = shared_data.crackedpwddir
19208 elif path.startswith('/vulnerabilities'):
19209 actual_path = shared_data.vulnerabilities_dir
19210 elif path.startswith('/logs'):
19211 actual_path = shared_data.datadir + '/logs'
19212 elif path.startswith('/backups'):
19213 actual_path = shared_data.backupdir
19214 elif path.startswith('/uploads'):
19215 actual_path = shared_data.upload_dir
19216

Callers

nothing calls this directly

Calls 7

safe_intFunction · 0.85
errorMethod · 0.80
is_enabledMethod · 0.45
valuesMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected