[dploot upgrade] Add --dpapi on WMI, WINRM and MSSQL protocols - #1327
[dploot upgrade] Add --dpapi on WMI, WINRM and MSSQL protocols#1327zblurx wants to merge 42 commits into
Conversation
Signed-off-by: zblurx <68540460+zblurx@users.noreply.github.com>
|
Perfecto @zblurx 🎉 |
NeffIsBack
left a comment
There was a problem hiding this comment.
This PR is actually a really good example on how to properly standardize file/registry access across protocols. We should probably implement something like that in NetExec as well to extend cross-protocol support for modules. E.g. cross-protocol support for spidering.
A few notes throughout the review:
- Maybe we should move all of the DPAPI logic into something like
/helpers/dpapi/so it has its own folder. Gets quite a lot :D - Firefox does not seem to be supported for WinRM at the moment. Was this intentional or is this a bug? Looking at the screenshot of @mpgn, looks like a bug related to my system?
Fyi, since we already have dpapi_machinekey detection logic I fixed this weird two-line output that impacket gives back as a string. Before&After (in one screenshot):
|
I think it's redundant to have a table to store DPAPI secrets and domain backup key in every protocol database. Maybe we should implement a dedicated dpapi database that would be shared between protocols ? Could be nice, especially for the domain backup key sharing between protocols. What do you think @NeffIsBack ? Maybe in another PR tho |
Each protocol is its own sqlite database file so you can run multiple protocols at the same time without them running into write issues, so we'd need to look into fixing that first. |
|
Yeah at the moment we only load the protocol specific database with no access to others, so there is no way of cross-protocol database access. I guess we could always load some additional "dpapi database" tho, but yeah additional PR if we would like to do that. Fyi, we need to revert #1378 in here so we always install dploot >4.0.0. |
NeffIsBack
left a comment
There was a problem hiding this comment.
If I saw it correctly (and the mobile version isn't bugged out) one logic bug slipped in with the (file) log implementation.
Description
I recently worked on a big refacto of DPLoot in order to support multiple network protocols.
This PR implements the DPLoot upgrade, also with a big refacto of the DPAPI functionalities in Netexec.
Now, Netexec supports
--dpapiin smb (not new), wmi, winrm and mssql protocols (including the DPAPI related database tables for each of them).The
--sccmhas also been implemented on wmi protocolBig update on the DPAPI SYSTEM triage : if the user wants to dump SYSTEM secrets, and therefore the DPAPI SYSTEM Machine and User keys are required, NetExec now calls
lsa()function of the network protocol automatically (as you can see in the screenshots). Unfortunately, wmi protocol does not have a pure WMI LSA dump, so no automatic DPAPI SYSTEM keys retrieval in WMI.A few modules have also been implemented in multiple protocols :
dpapi_hash,mobaxterm,mremoteng,rdcman,vnc,wamandwifiThe code has also been refactored in order to implement a better looting methodology : in the case you use multiple DPAPI related functionalities in one command (for example
nxc wmi [....] --dpapi -M wam -M rdcman), masterkeys will be dumped once.You will notice that the dependency is linked to a custom branch of dploot. I prefer it to keep it that way for the testing phase of the PR. Once everything will be validated, I'll push a clean release of dploot and will update the pyproject.toml
Type of change
Insert an "x" inside the brackets for relevant items (do not delete options)
Setup guide for the review
Install GOAD lab and add up a few secrets on some servers
Screenshots (if appropriate):
Checklist:
Insert an "x" inside the brackets for completed and relevant items (do not delete options)
poetry run ruff check ., use--fixto automatically fix what it can)tests/e2e_commands.txtfile if necessary (new modules or features are required to be added to the e2e tests)