creddump
creddump copied to clipboard
problem with non ascii characters
> python pwdump.py system SAM
Administrateur:500:XXXXXXXXXXXXXXXX:YYYYYYYYYYYYYYYY:::
Traceback (most recent call last):
File "pwdump.py", line 31, in <module>
dump_file_hashes(sys.argv[1], sys.argv[2])
File "/tmp/cr/creddump-0.1/framework/win32/hashdump.py", line 244, in
dump_file_hashes
dump_hashes(sysaddr, samaddr)
File "/tmp/cr/creddump-0.1/framework/win32/hashdump.py", line 239, in
dump_hashes
lmhash.encode('hex'), nthash.encode('hex'))
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in
position 5: ordinal not in range(128)
I guess it is because of the "Invité" account and the "é" character.
Thanks for this tools, I think it will be useful.
Original issue reported on code.google.com by [email protected] on 23 Mar 2009 at 8:03
[deleted comment]
You should check your system's locale.
Try export LANG=fr_FR.UTF-8.
It solved the problem for me.
Original comment by [email protected] on 29 Jan 2013 at 11:24
Hello,
To solve this problem, I encode the username in UTF-8.
Here is the line to patch: (hashdump.py:230)
print "%s:%d:%s:%s:::" % (get_user_name(user).encode('utf-8'),
int(user.Name,16),
lmhash.encode('hex'), nthash.encode('hex'))
Original comment by [email protected] on 18 Aug 2014 at 2:26