|
17 | 17 | import urllib.request |
18 | 18 | import warnings |
19 | 19 | from collections import defaultdict |
20 | | -from itertools import chain, product |
| 20 | +from itertools import product |
21 | 21 | from pathlib import Path |
22 | 22 | from typing import TYPE_CHECKING, BinaryIO, NamedTuple, NoReturn |
23 | 23 |
|
24 | 24 | from dissect.target import Target |
25 | 25 | from dissect.target.filesystems import ntfs |
26 | 26 | from dissect.target.helpers import fsutil |
27 | 27 | from dissect.target.loaders.local import _windows_get_devices |
28 | | -from dissect.target.plugins.apps.webserver import iis |
| 28 | +from dissect.target.plugins.apps.webserver.apache import ApachePlugin |
| 29 | +from dissect.target.plugins.apps.webserver.caddy import CaddyPlugin |
| 30 | +from dissect.target.plugins.apps.webserver.iis import IISLogsPlugin |
| 31 | +from dissect.target.plugins.apps.webserver.nginx import NginxPlugin |
29 | 32 | from dissect.target.plugins.os.windows.cam import CamPlugin |
30 | 33 | from dissect.target.plugins.os.windows.log import evt, evtx |
31 | 34 | from dissect.target.tools.utils.cli import args_to_uri |
@@ -870,15 +873,36 @@ class IIS(Module): |
870 | 873 |
|
871 | 874 | @classmethod |
872 | 875 | def get_spec_additions(cls, target: Target, cli_args: argparse.Namespace) -> Iterator[tuple]: |
873 | | - spec = { |
874 | | - ("glob", "sysvol\\Windows\\System32\\LogFiles\\W3SVC*\\*.log"), |
875 | | - ("glob", "sysvol\\Windows.old\\Windows\\System32\\LogFiles\\W3SVC*\\*.log"), |
876 | | - ("glob", "sysvol\\inetpub\\logs\\LogFiles\\*.log"), |
877 | | - ("glob", "sysvol\\inetpub\\logs\\LogFiles\\W3SVC*\\*.log"), |
878 | | - ("glob", "sysvol\\Resources\\Directory\\*\\LogFiles\\Web\\W3SVC*\\*.log"), |
879 | | - } |
880 | | - iis_plugin = iis.IISLogsPlugin(target) |
881 | | - spec.update(("path", log_path) for log_path in chain(*iis_plugin.log_dirs.values())) |
| 876 | + warnings.warn( |
| 877 | + "--iis is deprecated in favor of --webserver-logs and will be removed in acquire 3.22", |
| 878 | + DeprecationWarning, |
| 879 | + stacklevel=2, |
| 880 | + ) |
| 881 | + return Webserver.get_spec_additions(cls, target, cli_args) |
| 882 | + |
| 883 | + |
| 884 | +@register_module("--webserver") |
| 885 | +class Webserver(Module): |
| 886 | + DESC = "Various webserver logs and configuration files" |
| 887 | + |
| 888 | + @classmethod |
| 889 | + def get_spec_additions(cls, target: Target, cli_args: argparse.Namespace) -> Iterator[tuple]: |
| 890 | + spec = set() |
| 891 | + subclasses = [ |
| 892 | + ApachePlugin, |
| 893 | + CaddyPlugin, |
| 894 | + IISLogsPlugin, |
| 895 | + NginxPlugin, |
| 896 | + ] |
| 897 | + |
| 898 | + for subclass in subclasses: |
| 899 | + if subclass.__name__ == "IISLogsPlugin" and target.os != "windows": |
| 900 | + continue |
| 901 | + |
| 902 | + webserver = subclass(target) |
| 903 | + for log_path in webserver.get_all_paths(): |
| 904 | + spec.add(("path", log_path)) |
| 905 | + |
882 | 906 | return spec |
883 | 907 |
|
884 | 908 |
|
|
0 commit comments