diff --git a/dissect/target/plugins/os/windows/network.py b/dissect/target/plugins/os/windows/network.py index dac8de698..d29d00a39 100644 --- a/dissect/target/plugins/os/windows/network.py +++ b/dissect/target/plugins/os/windows/network.py @@ -257,7 +257,8 @@ def _interfaces(self) -> Iterator[WindowsInterfaceRecord]: continue # Extract the network device configuration for given interface id - config = self._extract_network_device_config(net_cfg_instance_id) + if not (config := self._extract_network_device_config(net_cfg_instance_id)): + continue # Extract a network device name for given interface id try: @@ -313,9 +314,7 @@ def _interfaces(self) -> Iterator[WindowsInterfaceRecord]: _target=self.target, ) - def _extract_network_device_config( - self, interface_id: str - ) -> list[dict[str, str | list], dict[str, str | list]] | None: + def _extract_network_device_config(self, interface_id: str) -> list[dict[str, set | bool | None]]: """Extract network device configuration from the given interface_id for all ControlSets on the system.""" dhcp_config = { @@ -344,10 +343,10 @@ def _extract_network_device_config( ) ) except RegistryKeyNotFoundError: - return None + return [] if not len(keys): - return None + return [] for key in keys: # Extract DHCP configuration from the registry