byt3bl33d3r / CrackMapExec

A swiss army knife for pentesting networks
BSD 2-Clause "Simplified" License
8.38k stars 1.64k forks source link

decode gb2312 error #103

Closed ismilent closed 7 years ago

ismilent commented 8 years ago

"/Users/Smilent/Hacktool/pentest/CrackMapExec/core/connection.py" the last line: return u'{}'.format(output.strip().decode('utf-8'))

return codecs.utf_8_decode(input, errors, True) UnicodeDecodeError: 'utf8' codec can't decode byte 0xb5 in position 3: invalid start byte <Greenlet at 0x10bea7d70: connector('10.211.55.9', Namespace(command='net user', cred_id=None, depth=, <core.database.CMEDatabase instance at 0x10bf7bd88, None, None, None)> failed with UnicodeDecodeError

fix : encoding = chardet.detect(output).get('encoding') return u'{}'.format(output.strip().decode(encoding))

wudidong commented 8 years ago

666 这玩意全是UTF-8的