This commit is contained in:
overcuriousity 2025-09-11 16:31:40 +02:00
parent 2a87403cb6
commit 0021bbc696

View File

@ -420,7 +420,7 @@ class Scanner:
elif _is_valid_ip(target):
discovered_targets_by_type[NodeType.IP].add(target)
targets_to_skip_recursion = set()
targets_to_skip = set()
for node_type, targets in discovered_targets_by_type.items():
if len(targets) > self.config.large_entity_threshold:
print(f"Large number of {node_type.value}s ({len(targets)}) found for {domain}. Creating a large entity node.")
@ -428,7 +428,7 @@ class Scanner:
first_rel = next((r for r in all_relationships if r[1] in targets), None)
if first_rel:
self._handle_large_entity(domain, list(targets), first_rel[2], first_rel[5])
targets_to_skip_recursion.update(targets)
targets_to_skip.update(targets)
# Step 3: Process all relationships to create/update nodes and edges
@ -443,7 +443,7 @@ class Scanner:
if provider_name == 'crtsh' and 'domain_certificates' in raw_data:
domain_certs = raw_data.get('domain_certificates', {})
for cert_domain, cert_summary in domain_certs.items():
if _is_valid_domain(cert_domain):
if _is_valid_domain(cert_domain) and cert_domain not in targets_to_skip:
# Create the node with its metadata. If node exists, metadata is updated.
self.graph.add_node(cert_domain, NodeType.DOMAIN, metadata={'certificate_data': cert_summary})
@ -451,7 +451,7 @@ class Scanner:
self._collect_node_metadata(source, provider_name, rel_type, target, raw_data, domain_metadata[source])
# Add nodes and edges to the graph
if target in targets_to_skip_recursion:
if target in targets_to_skip:
continue
if _is_valid_ip(target):