Mask attack functionality
#1
Im a developer and im interested in studying the mechanism of generating passwords for mask attack.
I've already found functionality of rule mode attack but seems to be another attack mode.
So i would like to know which src files contain functionality of mask attack and how does it work on cpu/gpu
Reply
#2
This is kind of hard to answer, as there is a lot involved in masks but put simply, Hashcat distributes the first 4 bytes to as many threads on the GPU as it can (called the base loop), then each of those threads has an inner loop (called the mod loop), where the rest of the candidate is generated by the GPU itself, so if you had ?l?l?l?l?d?d?d?d, the outer loop would be ?l?l?l?l and the inner loop would be ?d?d?d?d. This is the reason why if you use a mask like "ABCD?a?a?a?a?a?a", it'll be extraordinarily slow, because there'll only be a single candidate, "ABCD" to distribute to the CPU/GPU threads, while if you do it the other way around, as "?a?a?a?a?a?aABCD", it'll be near full speed as it can be parallelised fully
Reply
#3
I found outer_loop and inner_loops only in hashcat.c
Also found topic on hashcat wiki about amplifier loop and base loop but theres no information about how do these call in src files

also found files mpsp.c/h which produces passwords with cpu but didnt find the thing about gpu
Reply
#4
Seems like CPU password generating doesnt work. If i use --stdout with -S (--slow-candidates) flag it doesnt print anything but without -S does well (cpu + gpu generating).
Reply
#5
Well, it prints something. Empty lines.

$ ./hashcat.bin -a 3 ?d -S --stdout | wc -l
10
Reply
#6
I checked binary and there re just nulls
Dont think its should be like that

Found functionality - hashcat creates threads with thread_calc or thread_calc_stdin from dispatch.c
In case of CPU it uses mpsp functions but in case of cpu-gpu chain dont know
Reply
#7
I found
Passwords being generated in markov_le(be).cl

Does it has any connection with markov chains?
Reply