Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Acquire device list #198

Merged
merged 3 commits into from
Oct 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
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(

Check warning on line 402 in acquire/acquire.py

View check run for this annotation

Codecov / codecov/patch

acquire/acquire.py#L396-L402

Added lines #L396 - L402 were not covered by tests
"- Failed to collect output from command `QueryDosDeviceA`",
exc_info=True,
)
return

Check warning on line 406 in acquire/acquire.py

View check run for this annotation

Codecov / codecov/patch

acquire/acquire.py#L406

Added line #L406 was not covered by tests


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

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