initial targets managed in backend

This commit is contained in:
overcuriousity 2025-09-17 21:29:18 +02:00
parent b985f1e5f0
commit a56755320c
3 changed files with 8 additions and 14 deletions

View File

@ -55,6 +55,7 @@ class Scanner:
self.task_queue = PriorityQueue()
self.target_retries = defaultdict(int)
self.scan_failed_due_to_retries = False
self.initial_targets = set()
# Thread-safe processing tracking (from Document 1)
self.currently_processing = set()
@ -289,6 +290,7 @@ class Scanner:
if clear_graph:
self.graph.clear()
self.initial_targets.clear()
if force_rescan_target and self.graph.graph.has_node(force_rescan_target):
node_data = self.graph.graph.nodes[force_rescan_target]
@ -296,6 +298,7 @@ class Scanner:
node_data['metadata']['provider_states'] = {}
self.current_target = target.lower().strip()
self.initial_targets.add(self.current_target)
self.max_depth = max_depth
self.current_depth = 0
@ -852,7 +855,9 @@ class Scanner:
def get_graph_data(self) -> Dict[str, Any]:
"""Get current graph data for visualization."""
return self.graph.get_graph_data()
graph_data = self.graph.get_graph_data()
graph_data['initial_targets'] = list(self.initial_targets)
return graph_data
def export_results(self) -> Dict[str, Any]:
"""Export complete scan results with forensic audit trail."""

View File

@ -367,6 +367,7 @@ class GraphManager {
this.initialize();
}
this.initialTargetIds = new Set(graphData.initial_targets || []);
// Check if we have actual data to display
const hasData = graphData.nodes.length > 0 || graphData.edges.length > 0;
@ -1053,7 +1054,7 @@ class GraphManager {
this.edges.clear();
this.history = [];
this.largeEntityMembers.clear(); // Clear large entity tracking
this.clearInitialTargets();
this.initialTargetIds.clear();
// Show placeholder
const placeholder = this.container.querySelector('.graph-placeholder');
@ -1228,16 +1229,6 @@ class GraphManager {
};
}
addInitialTarget(targetId) {
this.initialTargetIds.add(targetId);
console.log("Initial targets:", this.initialTargetIds);
}
clearInitialTargets() {
this.initialTargetIds.clear();
console.log("Initial targets cleared.");
}
updateFilterControls() {
if (!this.filterPanel) return;
const nodeTypes = new Set(this.nodes.get().map(n => n.type));

View File

@ -301,8 +301,6 @@ class DNSReconApp {
this.graphManager.clear();
}
this.graphManager.addInitialTarget(target);
console.log(`Scan started for ${target} with depth ${maxDepth}`);
// Start polling immediately with faster interval for responsiveness