byt3bl33d3r/CrackMapExec

'utf-8' codec can't decode byte 0xf1

sec13b opened this issue · 6 comments

sec13b commented

any help.
Thank you
image

suljov commented

did it get fixed or you found an fix? i have this too

suljov commented

i maybe found a loop hole or a reason. test using another wordlist. rockyou is "UTF-8 text" but other wordlists are "ASCII text" and those will work.

but this dont fix the fact it cant read files that are "UTF-8 text", some people want/have to use the rockyou wordlist and cant do it right now

sec13b commented

i didn't fix

Can be fixed by simply opening the rockyou.txt in a text editor like leafpad and in save as option use the UTF-8 encoding while saving this will solve the issue

suljov commented

Can be fixed by simply opening the rockyou.txt in a text editor like leafpad and in save as option use the UTF-8 encoding while saving this will solve the issue

error say

"UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf1 in position 933: invalid continuation byte "

and checking rockyou.txt we get

$ file /usr/share/wordlists/rockyou.txt
/usr/share/wordlists/rockyou.txt: Unicode text, UTF-8 text

sec13b commented

Some of the wordlists I have downloaded from the inter-webs have had malformed utf-8 contents. You can run this Linux command to clean up the UTF-8 by removing any non UTF-8 characters:

sudo iconv -f utf-8 -t utf-8 -c rockyou.txt

or

sudo iconv -f utf-8 -t utf-8 -c rockyou.txt > rockyou_utf_8.txt  (keep original rockyou.txt)

It's also wise to clean up any leading white-space since I don't know how john the ripper or other cracking applications will deal with it.

sed "s/^[ \t]*//" -i rockyou.txt
sed "s/^[ \t]*//" -i rockyou_utf_8..txt
┌──(kali㉿kali)-[~/CrackMapExec]
└─$ poetry run crackmapexec rdp 192.168.1.14 -u you -p /usr/share/wordlists/rockyou_utf_8.txt --no-brutepass