Skip to content

Commit

Permalink
Fix error in windows network plugins
Browse files Browse the repository at this point in the history
Add optional params to _get_config_value to split value according to a list of character
Regression added in fox-it#870
  • Loading branch information
william-billaud committed Nov 20, 2024
1 parent 4d0c963 commit 635d5eb
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions dissect/target/plugins/os/windows/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,7 @@ def _interfaces(self) -> Iterator[WindowsInterfaceRecord]:
# Extract a network device name for given interface id
try:
name_key = self.target.registry.key(
f"HKLM\\SYSTEM\\CurrentControlSet\\Control\\Network\\{{4D36E972-E325-11CE-BFC1-08002BE10318}}\\{net_cfg_instance_id}\\Connection"
# noqa: E501
f"HKLM\\SYSTEM\\CurrentControlSet\\Control\\Network\\{{4D36E972-E325-11CE-BFC1-08002BE10318}}\\{net_cfg_instance_id}\\Connection" # noqa: E501
)
if value_name := _try_value(name_key, "Name"):
device_info["name"] = value_name
Expand All @@ -277,8 +276,7 @@ def _interfaces(self) -> Iterator[WindowsInterfaceRecord]:
# Extract the metric value from the interface registry key
try:
interface_key = self.target.registry.key(
f"HKLM\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\{net_cfg_instance_id}"
# noqa: E501
f"HKLM\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\{net_cfg_instance_id}" # noqa: E501
)
if value_metric := _try_value(interface_key, "InterfaceMetric"):
device_info["metric"] = value_metric
Expand Down

0 comments on commit 635d5eb

Please sign in to comment.