sjryjailcat / creddump

Automatically exported from code.google.com/p/creddump
GNU General Public License v3.0
1 stars 0 forks source link

problem with non ascii characters #2

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago

> 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 gerard.h...@gmail.com on 23 Mar 2009 at 8:03

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
You should check your system's locale.

Try export LANG=fr_FR.UTF-8.

It solved the problem for me.

Original comment by michelev...@gmail.com on 29 Jan 2013 at 11:24

GoogleCodeExporter commented 8 years ago
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 emeric.d...@gmail.com on 18 Aug 2014 at 2:26