Skip to content

Commit

Permalink
Acquire MSSQL error logs (#210)
Browse files Browse the repository at this point in the history
  • Loading branch information
Miauwkeru authored Jan 21, 2025
1 parent 771cb2b commit 1b3e67c
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions acquire/acquire.py
Original file line number Diff line number Diff line change
Expand Up @@ -770,6 +770,35 @@ def get_spec_additions(cls, target: Target, cli_args: argparse.Namespace) -> Ite
return spec


@register_module("--mssql")
class MSSQL(Module):
DESC = "MSSQL error logs"

SPEC = [("glob", "/var/opt/mssql/log/errorlog*")]

@classmethod
def get_spec_additions(cls, target: Target, cli_args: argparse.Namespace) -> Iterator[tuple[str, str]]:
log_paths = set()

if not target.has_function("registry"):
return

for reg_key in target.registry.glob_ext("HKLM\\SOFTWARE\\Microsoft\\Microsoft SQL Server\\*"):
try:
log_paths.add(reg_key.value("ErrorDumpDir").value)
except Exception:
pass

try:
subkey = reg_key.subkey("CPE")
log_paths.add(subkey.value("ErrorDumpDir").value)
except Exception:
pass

for log_path in log_paths:
yield ("glob", f"{log_path}/ERRORLOG*")


@register_module("--iis")
class IIS(Module):
DESC = "IIS logs"
Expand Down Expand Up @@ -1984,6 +2013,7 @@ class WindowsProfile:
IIS,
TextEditor,
Docker,
MSSQL,
]


Expand All @@ -2001,6 +2031,7 @@ class LinuxProfile:
Docker,
History,
WebHosting,
MSSQL,
]


Expand Down

0 comments on commit 1b3e67c

Please sign in to comment.