Trouble using å,ä,and ö in mask attack
#1
Hi everyone!

I have trouble getting my head around all the things regarding mask attacks. I live in Sweden and have a very hard time getting hold of any password lists in Swedish (please let me know if anyone have any ideas how I can get hold of some, thanks in advance!) . This has made me think that maybe the best way for me to crack passwords is via mask attacks, so a bit back I looked into making custom char sets that include the Swedish letters å,ä,ö. I also looked for some ideas about masks to use them with. I found one that I now have tried without any huge success at all. Im about to start to crack a word thats probably is going to take a while to crack, but before that I tried the charset and masks against some easier word both with and without the Swedish letters in them. I used 6 letter words in MD5-hash and it quickly cracked the word without å,ä,ö but it didn´t crack the Swedish word. As Iḿ no good at all at mask attacks, Iḿ not sure where the problem lies. It could be in my charset, the mask or maybe in the commandline. Iĺl write everything down so that you guys and girls get the whole picture and after that maybe if Iḿ lucky help me out a little with this.

Charsets:
--custom-charset1 sv_ISO-8859-4_19.hcchr = abcdefghijklmnopqrstuvwxyzåäöABCDEFGHIJKLMNOPQRSTUVWXYZÅÄÖ0123456789
--custom-charset2 sv_ISO-8859-4_16.hcchr = abcdefghijklmnopqrstuvwxyzåäö0123456789!@#$%^&*()-_+=~`[]{}|\:;"'<>,.?/
--custom-charset3 sv_ISO-8859-4_24.hcchr = abcdefghijklmnopqrstuvwxyzåäöABCDEFGHIJKLMNOPQRSTUVWXYZÅÄÖ0123456789!@#$%^&*()-_+=~`[]{}|\:;"'<>,.?/

Mask:
-1 ?l?s?d ?1?1?1?1?1?1?1?1

Commandline:
hashcat -a 3 -m 22000 -D 2 - O -w 4 -S --session=hem.restore --restore-file-path=/home/spcn/sessions-hashcat/hem.restore -o hem_out hem --custom-charset1 charsets/standard/Swedish/sv_ISO-8859-4_24.hcchr -1 ?l?s?d ?1?1?1?1?1?1?1?1

I would appreciate it very, very much if some one had the time yo help me sort this problem out. Thanks a million in advance everyone!
Reply
#2
short answer because no time, hashcat works on bytesize objects so cracking "single char" ä for example would mean your mask has to be of length 2 because in hex this char ä is c3 a4, å is c3 a5, take a look at an utf-8 char to hex conversion table and use hex charset as input (use a file for that)

simple example to crack the md5 for the german word öl (in hex c3 b6 6c) the mask needs to be at least of lenght 3, ?b?b?l

there is/was? a link in the wiki where someone explained this for foreign non plain ascii chars very well, or try to google this, in short take a look at your needed hex values and put them into two different charset (as you can see both chars, for sure all three starts with c3 in hex so you need to "add" hec c3 for all positions
Reply
#3
Thanks you ever so much for the answer! But o my god I feel so extremely unintelligent when I try to get this stuff in to my head. I took your advice and googled a utf-8 char to hex conversion table. But shall I just copy that in to two charsets? This is the one I found https://www.utf8-chartable.de/ . Iḿ so very sorry for all my stupid questions, I really hope they don´t drive you mad
Reply
#4
(08-17-2023, 01:35 PM)Snoopy Wrote: short answer because no time, hashcat works on bytesize objects so cracking "single char" ä for example would mean your mask has to be of length 2 because in hex this char ä is c3 a4, å is c3 a5, take a look at an utf-8 char to hex conversion table and use hex charset as input (use a file for that)
Can you please elaborate? Take your time.

(08-17-2023, 01:35 PM)Snoopy Wrote: simple example to crack the md5 for the german word öl (in hex c3 b6 6c) the mask needs to be at least of lenght 3, ?b?b?l
Why does it take 3 bytes to encode 2 letters in UTF-8? By the way, in Swedish, "öl" is the kind of oil you can drink, not the kind you pour into an engine. Das Bier! As I recall, it was a German guy who came up with the UTF-8 encoding. The world wanted UTF-16. It's said to be a nice hack. But I haven't read much about it or know the name of the guy.

(08-17-2023, 01:35 PM)Snoopy Wrote: there is/was? a link in the wiki where someone explained this for foreign non plain ascii chars very well, or try to google this
I'm not exactly sure what to look for. If it's in the wiki, can you please post a link here?

(08-17-2023, 01:35 PM)Snoopy Wrote: in short take a look at your needed hex values and put them into two different charset (as you can see both chars, for sure all three starts with c3 in hex so you need to "add" hec c3 for all positions
Are you saying that every character needs to be converted to UTF-8 hex? Why have two sets and not one? I see that "ä" is "c3 a4" and "å" is "c3 a5". So what's the idea then?... you have one set that starts with "c3" and then append "a4" and "a5" for "ä" and "å" respectively? Programmatically?...

(08-19-2023, 08:42 PM)CornyHorn Wrote: Thanks you ever so much for the answer! But o my god I feel so extremely unintelligent when I try to get this stuff in to my head. I took your advice and googled a utf-8 char to hex conversion table. But shall I just copy that in to two charsets? This is the one I found https://www.utf8-chartable.de/ . Iḿ so very sorry for all my stupid questions, I really hope they don´t drive you mad

Don't be so apologetic for no reason and so hard on yourself. It's not good for your self-confidence. Stupid questions? Extremely unintelligent? Come on! You got to be kidding. Even if you're only saying this to get an answer, you're not doing anyone a favor, and least of all yourself. You say you can't get this stuff into your head. If I may ask, how big is your head? Have you tried taking it in small bites? There is no royal road to knowledge. Rome wasn't built in one day, etc.

I'm sorry I can't help you with this. I don't know all the answers either. Just stay low and take it slow, until you know. Yo!? Take your time. Here is something else for you to think about. This is a quote by Dave McKay of How-To-Geek. "Complexity is usually just a lot of simplicity bolted together. Once you understand the fundamental building blocks, you can create efficient, powerful utilities, and develop valuable new skills."

One question for you! How often do people in Sweden use å, ä and ö in their passwords? If these letters are used only by 1% of all users, do you really need a special character set that would include these letters? Just something to think about. But this looks like a good start, if you want to build your own dictionary (or just want to know the stats for Swedish password habits): Swedish Passwords - Analysis of Swedish password usage.
Reply
#5
it all has to with possbile storage and combinations

it all started with ascii (8 bit, 1 byte) combinations = 255

take a look

https://www.asciitable.com/

you see ascii and extended ascii uses these 255 combinations so 1 byte is "full" it cannot encode more than this, no other chars possible, so utf-8 and other encodings came up, UTF-8 today can have a length 1-4 bytes to encode all the other possibilities.

https://www.utf8-chartable.de/unicode-utf8-table.pl

thats why äöü and other chars need 2 bytes for encoding, if you scroll down on the utf-8 chart table you will find some weird languages which uses 4 bytes, but this way utf-8 can encode every? language and chars on the world, at the end of the list there should be all emoticons and symbols
Reply