fixes to iteration context menu

This commit is contained in:
overcuriousity 2025-09-15 21:37:19 +02:00
parent 93a258170a
commit 71b2855d01
3 changed files with 15 additions and 6 deletions

5
app.py
View File

@ -72,8 +72,9 @@ def start_scan():
target = data['target'].strip() target = data['target'].strip()
max_depth = data.get('max_depth', config.default_recursion_depth) max_depth = data.get('max_depth', config.default_recursion_depth)
clear_graph = data.get('clear_graph', True) clear_graph = data.get('clear_graph', True)
force_rescan_target = data.get('force_rescan_target', None) # **FIX**: Get the new parameter
print(f"Parsed - target: '{target}', max_depth: {max_depth}, clear_graph: {clear_graph}") print(f"Parsed - target: '{target}', max_depth: {max_depth}, clear_graph: {clear_graph}, force_rescan: {force_rescan_target}")
# Validation # Validation
if not target: if not target:
@ -104,7 +105,7 @@ def start_scan():
print(f"Using scanner {id(scanner)} in session {user_session_id}") print(f"Using scanner {id(scanner)} in session {user_session_id}")
success = scanner.start_scan(target, max_depth, clear_graph=clear_graph) success = scanner.start_scan(target, max_depth, clear_graph=clear_graph, force_rescan_target=force_rescan_target) # **FIX**: Pass the new parameter
if success: if success:
return jsonify({ return jsonify({

View File

@ -204,7 +204,7 @@ class Scanner:
self._initialize_providers() self._initialize_providers()
print("Session configuration updated") print("Session configuration updated")
def start_scan(self, target: str, max_depth: int = 2, clear_graph: bool = True) -> bool: def start_scan(self, target: str, max_depth: int = 2, clear_graph: bool = True, force_rescan_target: Optional[str] = None) -> bool:
"""Start a new reconnaissance scan with proper cleanup of previous scans.""" """Start a new reconnaissance scan with proper cleanup of previous scans."""
print(f"=== STARTING SCAN IN SCANNER {id(self)} ===") print(f"=== STARTING SCAN IN SCANNER {id(self)} ===")
print(f"Session ID: {self.session_id}") print(f"Session ID: {self.session_id}")
@ -268,6 +268,13 @@ class Scanner:
if clear_graph: if clear_graph:
self.graph.clear() self.graph.clear()
if force_rescan_target and self.graph.graph.has_node(force_rescan_target):
print(f"Forcing rescan of {force_rescan_target}, clearing provider states.")
node_data = self.graph.graph.nodes[force_rescan_target]
if 'metadata' in node_data and 'provider_states' in node_data['metadata']:
node_data['metadata']['provider_states'] = {}
self.current_target = target.lower().strip() self.current_target = target.lower().strip()
self.max_depth = max_depth self.max_depth = max_depth
self.current_depth = 0 self.current_depth = 0

View File

@ -203,7 +203,7 @@ class DNSReconApp {
const { nodeId } = e.detail; const { nodeId } = e.detail;
console.log(`Received iterateScan event for node: ${nodeId}`); console.log(`Received iterateScan event for node: ${nodeId}`);
this.elements.targetInput.value = nodeId; this.elements.targetInput.value = nodeId;
this.startScan(false); // Start scan in "add to graph" mode this.startScan(false, nodeId); // Pass nodeId to force rescan
}); });
// Keyboard shortcuts // Keyboard shortcuts
@ -246,7 +246,7 @@ class DNSReconApp {
/** /**
* Start scan with error handling * Start scan with error handling
*/ */
async startScan(clearGraph = true) { async startScan(clearGraph = true, forceRescanTarget = null) {
console.log('=== STARTING SCAN ==='); console.log('=== STARTING SCAN ===');
try { try {
@ -279,7 +279,8 @@ class DNSReconApp {
const requestData = { const requestData = {
target: target, target: target,
max_depth: maxDepth, max_depth: maxDepth,
clear_graph: clearGraph clear_graph: clearGraph,
force_rescan_target: forceRescanTarget
}; };
console.log('Request data:', requestData); console.log('Request data:', requestData);