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

Fix secretsdump not able to retrieve autologon default username #102

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Dfte
Copy link
Contributor

@Dfte Dfte commented Oct 21, 2024

As of now, DonPAPI isn't able to retrieve the default username used for autologon:

image

This is because in the secretdumps DonPAPIRemoteOperations, the getDefaultLoginAccount function was omitted. As such, I added this piece of code (line 3268):

def getDefaultLoginAccount(self):
        try:
            ans = rrp.hBaseRegOpenKey(self.__rrp, self.__regHandle, 'SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon')
            keyHandle = ans['phkResult']
            dataType, dataValue = rrp.hBaseRegQueryValue(self.__rrp, keyHandle, 'DefaultUserName')
            username = dataValue[:-1]
            dataType, dataValue = rrp.hBaseRegQueryValue(self.__rrp, keyHandle, 'DefaultDomainName')
            domain = dataValue[:-1]
            rrp.hBaseRegCloseKey(self.__rrp, keyHandle)
            if len(domain) > 0:
                return '%s\\%s' % (domain,username)
            else:
                return username
        except:
            return None

DonPAPIRemoteOperations having the necessary function, it can now retrieve this value and print the correct value:

image

Note: before merging, this branch will be in conflit with this PR:

@Dfte Dfte changed the title Update secretsdump.py Fix secretsdump not able to retrieve autologon default username Oct 21, 2024
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