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

Function get_traffic_debug

webapp_modern.py:16887–16947  ·  view source on GitHub ↗

Debug endpoint for traffic analyzer

()

Source from the content-addressed store, hash-verified

16885 }
16886 })
16887 else:
16888 # Fallback to legacy credential data - just return empty structure
16889 return jsonify({
16890 'credentials': [],
16891 'network_context': {
16892 'current_network': 'legacy',
16893 'count': 0
16894 }
16895 })
16896
16897 except Exception as e:
16898 logger.error(f"Error getting credentials: {e}")
16899 return jsonify({'error': str(e)}), 500
16900
16901
16902@app.route('/api/network-intelligence/add-vulnerability', methods=['POST'])
16903def add_vulnerability():
16904 """Add a new vulnerability finding"""
16905 try:
16906 if not (hasattr(shared_data, 'network_intelligence') and
16907 shared_data.network_intelligence and
16908 shared_data.config.get('network_intelligence_enabled', True)):
16909 return jsonify({'error': 'Network intelligence not available'}), 400
16910
16911 data = request.get_json()
16912 required_fields = ['host', 'port', 'service', 'vulnerability']
16913
16914 if not all(field in data for field in required_fields):
16915 return jsonify({'error': 'Missing required fields'}), 400
16916
16917 vuln_id = shared_data.network_intelligence.add_vulnerability(
16918 host=data['host'],
16919 port=data['port'],
16920 service=data['service'],
16921 vulnerability=data['vulnerability'],
16922 severity=data.get('severity', 'medium'),
16923 details=data.get('details', {})
16924 )
16925
16926 if vuln_id:
16927 # Trigger sync and broadcast update
16928 sync_all_counts()
16929 broadcast_status_update()
16930
16931 return jsonify({
16932 'success': True,
16933 'vulnerability_id': vuln_id,
16934 'message': 'Vulnerability added successfully'
16935 })
16936 else:
16937 return jsonify({'error': 'Failed to add vulnerability'}), 500
16938
16939 except Exception as e:
16940 logger.error(f"Error adding vulnerability: {e}")
16941 return jsonify({'error': str(e)}), 500
16942
16943
16944@app.route('/api/network-intelligence/add-credential', methods=['POST'])

Callers

nothing calls this directly

Calls 3

appendMethod · 0.80
get_traffic_analyzerFunction · 0.70
runMethod · 0.45

Tested by

no test coverage detected