Skip to content

Feature/wmi multitool - #9

Merged
aconite33 merged 2 commits into
masterfrom
feature/wmi-multitool
Aug 19, 2026
Merged

Feature/wmi multitool#9
aconite33 merged 2 commits into
masterfrom
feature/wmi-multitool

Conversation

@aconite33

Copy link
Copy Markdown

No description provided.

…l.py

Adds 'reg takeown' subcommand that takes ownership of TrustedInstaller-owned
registry keys via Remote Registry (MS-RRP). Uses RegSetKeySecurity to change
owner to Administrators, then sets a DACL granting Administrators + SYSTEM
full control and Everyone read access. Required for COM CLSID TreatAs hijack
technique where WbemLocator InprocServer32 key is TrustedInstaller-owned.

Also adds imports for SMBConnection, transport, and rrp modules.
wmimultitool.py:
- Add 'file takeown' command: CIM_DataFile.TakeOwnerShip() to change
  file owner from TrustedInstaller to Administrators, then
  Win32_LogicalFileSecuritySetting.SetSecurityDescriptor() to set
  DACL granting Administrators + SYSTEM full control
- Pure WMI over DCOM (port 135), no subprocess, no icacls.exe

impacket/dcerpc/v5/dcom/wmi.py:
- Fix marshalMe() to serialize CIM_TYPE_OBJECT properties into the
  instance heap as EncodingLength+ObjectBlock (was always NULL)
- Fix marshalMe() to handle arrays of CIM_TYPE_OBJECT with proper
  heap pointer table construction
- Fix ENCODED_STRING.__init__ to set isUnicode=False when created
  without data (prevented embedded object string serialization)
- Fix marshalMe() to handle None string properties (pack as NULL
  instead of crashing)
@aconite33
aconite33 merged commit b4f263b into master Aug 19, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant