Skip to content

Feature request: add sswmi (WMI shadow snapshot) dump method to --sam/--lsa/--ntds #1360

Description

@hakimonr

Please Describe The Problem To Be Solved

During a recent internal engagement against EDR-protected Windows hosts, I could not use the current credential gathering options of the SMB protocol:

  • --sam / --lsa (both regdump and secdump) were blocked — remote registry hive access and reg save are heavily monitored by the endpoint protection,
  • --ntds vss was blocked — it creates a service and runs vssadmin remotely,
  • --ntds drsuapi was blocked as well.

The same targets were fully dumpable with impacket-secretsdump -use-remoteSSWMI. That method creates a Shadow Snapshot via WMI (Win32_ShadowCopy), downloads SAM, SYSTEM and SECURITY (and optionally NTDS.dit) over SMB from the snapshot, and deletes the snapshot afterwards. There is no code execution on the target at all: no service creation, no reg save, no vssadmin. In my testing, this approach produced no EDR alert, while every other method did.

NetExec is the de-facto standard tool for this kind of work, so having this method built-in would help a lot of people facing the same problem.

Scope: add a third, opt-in method next to the existing ones. The behaviour of regdump, secdump, vss and drsuapi stays unchanged.

Suggest A Solution

Add an sswmi choice to --sam, --lsa and --ntds, plus an optional --sswmi-volume (default C:\) for DCs where NTDS.dit lives on another volume:

nxc smb <target> -u user -p pass --sam sswmi
nxc smb <target> -u user -p pass --lsa sswmi
nxc smb <target> -u user -p pass --ntds sswmi
nxc smb <target> -u user -p pass --sam sswmi --ntds sswmi --sswmi-volume D:\

Implementation notes:

  • impacket's RemoteOperations already ships createSSandDownloadWMI() (the backend of -use-remoteSSWMI), and the impacket revision NetExec pins already contains it — no dependency change is needed.
  • Flow: WMI Win32_ShadowCopy.Create → read the hives back over SMB from the snapshot → delete the snapshot → parse locally (bootkey taken from the downloaded SYSTEM hive), same as the LOCAL mode of secretsdump.
  • When several of --sam/--lsa/--ntds are combined with sswmi, one snapshot is created and shared between them.
  • Existing options (--history, --kerberos-keys, --enabled, --user) keep working with the new method.

Tradeoffs / caveats:

  • Requires local admin, same as the other methods.
  • Requires DCOM/WMI (135) to be reachable; the volume needs to support shadow copies.
  • WMI itself can be monitored by some EDRs, but the signal profile is much lower than service creation or reg save.

I have a working prototype (2 files changed, no new dependencies) and can open a PR with it. The underlying approach (-use-remoteSSWMI) was verified by me in a real EDR-protected environment; the nxc integration is lint-clean and passes the existing test suite, but has not been tested against a live target yet — I will do that as soon as the direction is agreed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions