Compare commits
	
		
			2 Commits
		
	
	
		
			bcd79ae2f5
			...
			71a05f5b32
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					71a05f5b32 | ||
| 
						 | 
					1b0c630667 | 
@ -664,9 +664,6 @@ class Scanner:
 | 
			
		||||
        print(f"Enqueueing correlation tasks for {len(all_nodes)} nodes")
 | 
			
		||||
        
 | 
			
		||||
        for node_id in all_nodes:
 | 
			
		||||
            if self._is_stop_requested():
 | 
			
		||||
                break
 | 
			
		||||
                
 | 
			
		||||
            # Determine appropriate depth for correlation (use 0 for simplicity)
 | 
			
		||||
            correlation_depth = 0
 | 
			
		||||
            task_tuple = ('correlation', node_id, correlation_depth)
 | 
			
		||||
@ -684,7 +681,7 @@ class Scanner:
 | 
			
		||||
        consecutive_empty_iterations = 0
 | 
			
		||||
        max_empty_iterations = 20  # Shorter timeout for correlation phase
 | 
			
		||||
        
 | 
			
		||||
        while not self._is_stop_requested() and correlation_tasks:
 | 
			
		||||
        while correlation_tasks:
 | 
			
		||||
            queue_empty = self.task_queue.empty()
 | 
			
		||||
            with self.processing_lock:
 | 
			
		||||
                no_active_processing = len(self.currently_processing) == 0
 | 
			
		||||
@ -720,8 +717,6 @@ class Scanner:
 | 
			
		||||
                continue
 | 
			
		||||
 | 
			
		||||
            with self.processing_lock:
 | 
			
		||||
                if self._is_stop_requested():
 | 
			
		||||
                    break
 | 
			
		||||
                processing_key = (provider_name, target_item)
 | 
			
		||||
                if processing_key in self.currently_processing:
 | 
			
		||||
                    self.tasks_skipped += 1
 | 
			
		||||
@ -733,9 +728,6 @@ class Scanner:
 | 
			
		||||
                self.current_indicator = target_item
 | 
			
		||||
                self._update_session_state()
 | 
			
		||||
                
 | 
			
		||||
                if self._is_stop_requested():
 | 
			
		||||
                    break
 | 
			
		||||
                
 | 
			
		||||
                # Process correlation task
 | 
			
		||||
                new_targets, _, success = self._process_provider_task(correlation_provider, target_item, depth)
 | 
			
		||||
                
 | 
			
		||||
@ -762,7 +754,7 @@ class Scanner:
 | 
			
		||||
        Manages the entire process for a given target and provider.
 | 
			
		||||
        This version is generalized to handle all relationships dynamically.
 | 
			
		||||
        """
 | 
			
		||||
        if self._is_stop_requested():
 | 
			
		||||
        if self._is_stop_requested() and not isinstance(provider, CorrelationProvider):
 | 
			
		||||
            return set(), set(), False
 | 
			
		||||
    
 | 
			
		||||
        is_ip = _is_valid_ip(target)
 | 
			
		||||
@ -779,7 +771,8 @@ class Scanner:
 | 
			
		||||
    
 | 
			
		||||
            if provider_result is None:
 | 
			
		||||
                provider_successful = False
 | 
			
		||||
            elif not self._is_stop_requested():
 | 
			
		||||
            # Allow correlation provider to process results even if scan is stopped
 | 
			
		||||
            elif not self._is_stop_requested() or isinstance(provider, CorrelationProvider):
 | 
			
		||||
                # Pass all relationships to be processed
 | 
			
		||||
                discovered, is_large_entity = self._process_provider_result_unified(
 | 
			
		||||
                    target, provider, provider_result, depth
 | 
			
		||||
@ -799,7 +792,7 @@ class Scanner:
 | 
			
		||||
        provider_name = provider.get_name()
 | 
			
		||||
        start_time = datetime.now(timezone.utc)
 | 
			
		||||
        
 | 
			
		||||
        if self._is_stop_requested():
 | 
			
		||||
        if self._is_stop_requested() and not isinstance(provider, CorrelationProvider):
 | 
			
		||||
            return None
 | 
			
		||||
        
 | 
			
		||||
        try:
 | 
			
		||||
@ -808,7 +801,7 @@ class Scanner:
 | 
			
		||||
            else:
 | 
			
		||||
                result = provider.query_domain(target)
 | 
			
		||||
            
 | 
			
		||||
            if self._is_stop_requested():
 | 
			
		||||
            if self._is_stop_requested() and not isinstance(provider, CorrelationProvider):
 | 
			
		||||
                return None
 | 
			
		||||
            
 | 
			
		||||
            relationship_count = result.get_relationship_count() if result else 0
 | 
			
		||||
@ -902,7 +895,8 @@ class Scanner:
 | 
			
		||||
        large_entity_id = ""
 | 
			
		||||
        large_entity_members = set()
 | 
			
		||||
 | 
			
		||||
        if self._is_stop_requested():
 | 
			
		||||
        # Stop processing for non-correlation providers if requested
 | 
			
		||||
        if self._is_stop_requested() and not isinstance(provider, CorrelationProvider):
 | 
			
		||||
            return discovered_targets, False
 | 
			
		||||
 | 
			
		||||
        eligible_rel_count = sum(
 | 
			
		||||
@ -916,7 +910,8 @@ class Scanner:
 | 
			
		||||
            )
 | 
			
		||||
 | 
			
		||||
        for i, relationship in enumerate(provider_result.relationships):
 | 
			
		||||
            if i % 5 == 0 and self._is_stop_requested():
 | 
			
		||||
            # Stop processing for non-correlation providers if requested
 | 
			
		||||
            if i % 5 == 0 and self._is_stop_requested() and not isinstance(provider, CorrelationProvider):
 | 
			
		||||
                break
 | 
			
		||||
 | 
			
		||||
            source_node_id = relationship.source_node
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user