finalize pop-out
This commit is contained in:
		
							parent
							
								
									ecc143ddbb
								
							
						
					
					
						commit
						f0f80be955
					
				@ -135,8 +135,8 @@ class Scanner:
 | 
				
			|||||||
            'stop_event',
 | 
					            'stop_event',
 | 
				
			||||||
            'scan_thread', 
 | 
					            'scan_thread', 
 | 
				
			||||||
            'executor',
 | 
					            'executor',
 | 
				
			||||||
            'processing_lock',  # **NEW**: Exclude the processing lock
 | 
					            'processing_lock',
 | 
				
			||||||
            'task_queue', # PriorityQueue is not picklable
 | 
					            'task_queue',
 | 
				
			||||||
            'rate_limiter',
 | 
					            'rate_limiter',
 | 
				
			||||||
            'logger'
 | 
					            'logger'
 | 
				
			||||||
        ]
 | 
					        ]
 | 
				
			||||||
@ -147,7 +147,6 @@ class Scanner:
 | 
				
			|||||||
        
 | 
					        
 | 
				
			||||||
        # Handle providers separately to ensure they're picklable
 | 
					        # Handle providers separately to ensure they're picklable
 | 
				
			||||||
        if 'providers' in state:
 | 
					        if 'providers' in state:
 | 
				
			||||||
            # The providers should be picklable now, but let's ensure clean state
 | 
					 | 
				
			||||||
            for provider in state['providers']:
 | 
					            for provider in state['providers']:
 | 
				
			||||||
                if hasattr(provider, '_stop_event'):
 | 
					                if hasattr(provider, '_stop_event'):
 | 
				
			||||||
                    provider._stop_event = None
 | 
					                    provider._stop_event = None
 | 
				
			||||||
@ -162,14 +161,14 @@ class Scanner:
 | 
				
			|||||||
        self.stop_event = threading.Event()
 | 
					        self.stop_event = threading.Event()
 | 
				
			||||||
        self.scan_thread = None
 | 
					        self.scan_thread = None
 | 
				
			||||||
        self.executor = None
 | 
					        self.executor = None
 | 
				
			||||||
        self.processing_lock = threading.Lock()  # **NEW**: Recreate processing lock
 | 
					        self.processing_lock = threading.Lock()
 | 
				
			||||||
        self.task_queue = PriorityQueue()
 | 
					        self.task_queue = PriorityQueue()
 | 
				
			||||||
        self.rate_limiter = GlobalRateLimiter(redis.StrictRedis(db=0))
 | 
					        self.rate_limiter = GlobalRateLimiter(redis.StrictRedis(db=0))
 | 
				
			||||||
        self.logger = get_forensic_logger()
 | 
					        self.logger = get_forensic_logger()
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        # Re-initialize providers after unpickling from session storage
 | 
					        if not hasattr(self, 'providers') or not self.providers:
 | 
				
			||||||
        print("Re-initializing providers after loading session...")
 | 
					            print("Providers not found after loading session, re-initializing...")
 | 
				
			||||||
        self._initialize_providers()
 | 
					            self._initialize_providers()
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        if not hasattr(self, 'currently_processing'):
 | 
					        if not hasattr(self, 'currently_processing'):
 | 
				
			||||||
            self.currently_processing = set()
 | 
					            self.currently_processing = set()
 | 
				
			||||||
 | 
				
			|||||||
@ -1770,7 +1770,6 @@ class DNSReconApp {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    async extractNode(largeEntityId, nodeId) {
 | 
					    async extractNode(largeEntityId, nodeId) {
 | 
				
			||||||
        try {
 | 
					        try {
 | 
				
			||||||
            this.showInfo(`Extraction initiated for ${nodeId}. It will be processed by the scanner.`);
 | 
					 | 
				
			||||||
            const response = await this.apiCall('/api/graph/large-entity/extract', 'POST', {
 | 
					            const response = await this.apiCall('/api/graph/large-entity/extract', 'POST', {
 | 
				
			||||||
                large_entity_id: largeEntityId,
 | 
					                large_entity_id: largeEntityId,
 | 
				
			||||||
                node_id: nodeId,
 | 
					                node_id: nodeId,
 | 
				
			||||||
@ -1779,22 +1778,14 @@ class DNSReconApp {
 | 
				
			|||||||
            if (response.success) {
 | 
					            if (response.success) {
 | 
				
			||||||
                this.showSuccess(response.message);
 | 
					                this.showSuccess(response.message);
 | 
				
			||||||
                
 | 
					                
 | 
				
			||||||
                // The node is now in the queue. We don't need to force a graph update.
 | 
					                this.hideModal();
 | 
				
			||||||
                // Instead, we just need to update the modal view to show one less item.
 | 
					 | 
				
			||||||
                const graphResponse = await this.apiCall('/api/graph');
 | 
					 | 
				
			||||||
                if (graphResponse.success) {
 | 
					 | 
				
			||||||
                    const updatedLargeEntity = graphResponse.graph.nodes.find(n => n.id === largeEntityId);
 | 
					 | 
				
			||||||
                    if (updatedLargeEntity) {
 | 
					 | 
				
			||||||
                        this.showNodeModal(updatedLargeEntity);
 | 
					 | 
				
			||||||
                    } else {
 | 
					 | 
				
			||||||
                        // The entity might have been dismantled completely if it was the last node
 | 
					 | 
				
			||||||
                        this.hideModal();
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                // If the scanner was idle, it's now running. Start polling.
 | 
					                // If the scanner was idle, it's now running. Start polling to see the new node appear.
 | 
				
			||||||
                if (this.scanStatus === 'idle') {
 | 
					                if (this.scanStatus === 'idle') {
 | 
				
			||||||
                    this.startPolling(1000);
 | 
					                    this.startPolling(1000);
 | 
				
			||||||
 | 
					                } else {
 | 
				
			||||||
 | 
					                    // If already scanning, force a quick graph update to see the change sooner.
 | 
				
			||||||
 | 
					                    setTimeout(() => this.updateGraph(), 500);
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            } else {
 | 
					            } else {
 | 
				
			||||||
 | 
				
			|||||||
@ -94,10 +94,14 @@
 | 
				
			|||||||
                        <div id="progress-fill" class="progress-fill"></div>
 | 
					                        <div id="progress-fill" class="progress-fill"></div>
 | 
				
			||||||
                    </div>
 | 
					                    </div>
 | 
				
			||||||
                    <div class="progress-placeholder">
 | 
					                    <div class="progress-placeholder">
 | 
				
			||||||
                        <span class="status-label">Reconnaissance on a large domain could take very long. Don´t try to scan Google.com.</span>
 | 
					                        <span class="status-label">
 | 
				
			||||||
                        <br>
 | 
					                            ⚠️ <strong>Important:</strong> Scanning large public services (e.g., Google, Cloudflare, AWS) is
 | 
				
			||||||
                        <span class="status-label">The main bottleneck is the request to crt.sh which is subject to harsh rate-limits.
 | 
					                            <strong>discouraged</strong> due to rate limits (e.g., crt.sh).
 | 
				
			||||||
                        The processing is done via a task-queue which operates by the pronciple of highest-priority-first: Long-running-tasks will be done last.</span>
 | 
					                            <br><br>
 | 
				
			||||||
 | 
					                            Our task scheduler operates on a <strong>priority-based queue</strong>:
 | 
				
			||||||
 | 
					                            Short, targeted tasks like DNS are processed first, while resource-intensive requests (e.g., crt.sh)
 | 
				
			||||||
 | 
					                            are <strong>automatically deprioritized</strong> and may be processed later.
 | 
				
			||||||
 | 
					                        </span>
 | 
				
			||||||
                    </div>
 | 
					                    </div>
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
            </section>
 | 
					            </section>
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user