Posts: 10
Threads: 2
Joined: Jul 2024
07-26-2024, 01:23 PM
(This post was last modified: 07-26-2024, 01:28 PM by Scanel-sys.)
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
Posts: 165
Threads: 2
Joined: Apr 2021
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
Posts: 10
Threads: 2
Joined: Jul 2024
07-26-2024, 04:43 PM
(This post was last modified: 07-26-2024, 04:53 PM by Scanel-sys.)
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
Posts: 10
Threads: 2
Joined: Jul 2024
07-30-2024, 10:46 AM
(This post was last modified: 07-30-2024, 10:47 AM by Scanel-sys.)
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).
Posts: 57
Threads: 0
Joined: Dec 2022
Well, it prints something. Empty lines.
$ ./hashcat.bin -a 3 ?d -S --stdout | wc -l
10
Posts: 10
Threads: 2
Joined: Jul 2024
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
Posts: 10
Threads: 2
Joined: Jul 2024
I found
Passwords being generated in markov_le(be).cl
Does it has any connection with markov chains?