Agent: Replace fields in configuration using pydantic syntax in propagator

This commit is contained in:
Shreya Malviya 2022-08-30 12:28:12 +05:30
parent 45c6fda8b2
commit 163c54a8c3
1 changed files with 2 additions and 3 deletions

View File

@ -1,5 +1,4 @@
import logging
from dataclasses import replace
from ipaddress import IPv4Interface
from queue import Queue
from threading import Event
@ -93,9 +92,9 @@ class Propagator:
modified_options = fingerprinter.options.copy()
modified_options["http_ports"] = list(http_ports)
modified_fingerprinters[i] = replace(fingerprinter, options=modified_options)
modified_fingerprinters[i] = fingerprinter.copy(update={"options": modified_options})
return replace(network_scan, fingerprinters=modified_fingerprinters)
return network_scan.copy(update={"fingerprinters": modified_fingerprinters})
def _scan_network(self, scan_config: NetworkScanConfiguration, stop: Event):
logger.info("Starting network scan")