Skip to content

Commit

Permalink
Adjust regf glob to account for dot before instance name
Browse files Browse the repository at this point in the history
  • Loading branch information
Horofic committed Dec 20, 2024
1 parent 70c037b commit c26288a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions dissect/target/plugins/os/windows/log/mssql.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class MssqlPlugin(Plugin):

__namespace__ = "mssql"

MSSQL_KEY_GLOB = "HKLM\\SOFTWARE\\Microsoft\\Microsoft SQL Server\\MSSQL*"
MSSQL_KEY_GLOB = "HKLM\\SOFTWARE\\Microsoft\\Microsoft SQL Server\\MSSQL*.*"
FILE_GLOB = "ERRORLOG*"

def __init__(self, target: Target):
Expand Down Expand Up @@ -92,12 +92,12 @@ def errorlog(self) -> Iterator[MssqlErrorlogRecord]:
def _find_instances(self) -> set[str, TargetPath]:
instances = set()

import ipdb; ipdb.set_trace()
for subkey in self.target.registry.glob_ext(self.MSSQL_KEY_GLOB):
if "." in subkey.name:
instances.add(
(
subkey.name,
self.target.fs.path(subkey.subkey("SQLServerAgent").value("ErrorLogFile").value).parent,
)
instances.add(
(
subkey.name,
self.target.fs.path(subkey.subkey("SQLServerAgent").value("ErrorLogFile").value).parent,
)
)
return instances

0 comments on commit c26288a

Please sign in to comment.