Skip to content

Commit

Permalink
Acquire device list (#198)
Browse files Browse the repository at this point in the history
(DIS-897)
  • Loading branch information
cecinestpasunepipe authored Oct 24, 2024
1 parent 7177169 commit 6266553
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions acquire/acquire.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from dissect.target.filesystem import Filesystem
from dissect.target.filesystems import ntfs
from dissect.target.helpers import fsutil
from dissect.target.loaders.local import _windows_get_devices
from dissect.target.plugins.apps.webserver import iis
from dissect.target.plugins.os.windows.log import evt, evtx
from dissect.target.tools.utils import args_to_uri
Expand Down Expand Up @@ -384,6 +385,27 @@ class Netstat(Module):
EXEC_ORDER = ExecutionOrder.BOTTOM


@register_module("--devices")
@local_module
class Devices(Module):
DESC = "devices output"
EXEC_ORDER = ExecutionOrder.BOTTOM

@classmethod
def _run(cls, target: Target, cli_args: argparse.Namespace, collector: Collector) -> None:
try:
lines = _windows_get_devices()
collector.output.write_bytes("QueryDosDeviceA.txt", "\n".join(lines).encode("utf-8"))
collector.report.add_command_collected(cls.__name__, ["QueryDosDeviceA"])
except Exception:
collector.report.add_command_failed(cls.__name__, ["QueryDosDeviceA"])
log.error(
"- Failed to collect output from command `QueryDosDeviceA`",
exc_info=True,
)
return


@register_module("--win-processes")
@local_module
class WinProcesses(Module):
Expand Down Expand Up @@ -2019,6 +2041,7 @@ class OSXProfile:

class VolatileProfile:
DEFAULT = [
Devices,
Netstat,
WinProcesses,
WinProcEnv,
Expand Down

0 comments on commit 6266553

Please sign in to comment.