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

Remove unecessary error message when dumping default system accounts #94

Closed

Conversation

Dfte
Copy link
Contributor

@Dfte Dfte commented Oct 19, 2024

The following error message sometimes appears when dumping SAM databases:

image

This is because Windows uses default system accounts (such as WDAGUtilityAccount which is used by windows defender to test binaries in a virtual environment). Such accounts do not have authentication secrets and for a weird reason, impacket treats that as a LOG.error which results in the output of DonPAPI being messed up.

To remove this, I simply merged impacket/examples/secretsdump.py and impacket/impacket/examples/secretsdump.py together and switched the LOG.error to LOG.debug. I also removed the hexdump of the NL$KM value line 1661:

# Default print, hexdump
printableSecret  = '%s:%s' % (name, hexlify(secretItem).decode('utf-8'))
self.__secretItems.append(printableSecret)
# If we're using the default callback (ourselves), we print the hex representation. If not, the
# user will need to decide what to do.
if self.__module__ == self.__perSecretCallback.__module__:
    #hexdump(secretItem)
    pass
self.__perSecretCallback(LSASecrets.SECRET_TYPE.LSA_RAW, printableSecret)

Quite a brutal fix, may be you have got a simplier idea ?

@Dfte
Copy link
Contributor Author

Dfte commented Oct 20, 2024

To make this change a little bit less hard, I created the following issue fortra/impacket#1839.

@Dfte
Copy link
Contributor Author

Dfte commented Oct 21, 2024

Closing as I'll push a better version.

@Dfte Dfte closed this Oct 21, 2024
@Dfte Dfte deleted the Remove-unecessary-error-message branch October 21, 2024 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant