Skip to content

Commit

Permalink
credman error fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
AlessandroZ committed May 12, 2017
1 parent 70f9687 commit 93df4bb
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions Windows/lazagne/softwares/windows/credman.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,40 +11,24 @@ def __init__(self):
# entropy = 'abe2869f-9b47-4cd9-a358-c22904dba7f7\0' # FOR CRED_TYPE_GENERIC
# entropy = '82BD0E67-9FEA-4748-8672-D5EFE5B779B0\0' # FOR CRED_TYPE_DOMAIN_VISIBLE_PASSWORD

def run(self, software_name = None):
def run(self, software_name = None):
pwdFound = []
creds = POINTER(PCREDENTIAL)()
count = c_ulong()
print_debug('DEBUG', 'Run Credential manager function')
if CredEnumerate(None, 0, byref(count), byref(creds)) == 1:
print_debug('DEBUG', 'CredEnumerate executed successfully')
print_debug('DEBUG', 'cound variable: %s' % str(count))
print_debug('DEBUG', 'Number of value: %s' % str(count.value))
for i in range(count.value):
print_debug('DEBUG', 'cred[i] variable: %s' % str(creds[i]))
c = creds[i].contents
print_debug('DEBUG', 'c variable: %s' % str(c))
if c.Type == CRED_TYPE_GENERIC or c.Type == CRED_TYPE_DOMAIN_VISIBLE_PASSWORD:
print_debug('DEBUG', 'value to decrypt found')
# For XP:
# - password are encrypted with specific salt depending on its Type
# - call CryptUnprotectData(byref(blobIn), None, byref(blobEntropy), None, None, CRYPTPROTECT_UI_FORBIDDEN, byref(blobOut))

print_debug('DEBUG', 'target: %s' % str(c.TargetName))
print_debug('DEBUG', 'username: %s' % str(c.UserName))
print_debug('DEBUG', 'password: %s' % str(c.CredentialBlob))
print_debug('DEBUG', 'size of the password: %s' % str(c.CredentialBlobSize.real))
print_debug('DEBUG', 'everything ok')
pwdFound.append(
{
'URL' : c.TargetName,
'Login' : c.UserName,
'Password' : c.CredentialBlob[:c.CredentialBlobSize.real].replace('\x00', '')
}
)
print_debug('DEBUG', 'trying to free the handle')
CredFree(creds)
return pwdFound



0 comments on commit 93df4bb

Please sign in to comment.