hashcat Forum
Possible to do attack mode 6 and 7 on same attack - Printable Version

+- hashcat Forum (https://hashcat.net/forum)
+-- Forum: Support (https://hashcat.net/forum/forum-3.html)
+--- Forum: hashcat (https://hashcat.net/forum/forum-45.html)
+--- Thread: Possible to do attack mode 6 and 7 on same attack (/thread-7121.html)



Possible to do attack mode 6 and 7 on same attack - walterlacka - 12-19-2017

Should something like this work?

Code:
./hashcat -O -w3 -a6 dict.txt ?a?a?a?a -i --stdout | ./hashcat -O -w3 -m0 -a7 ?a?a -i 'hash'

Trying to accomplish having a dict.txt:
cat
dog
etc

And I want to add ?a?a to beginning and ?a?a?a?a to end of the wordlist


RE: Possible to do attack mode 6 and 7 on same attack - royce - 12-20-2017

Assuming the syntax is correct, that would indeed work - it would be slower than a direct on-GPU implementation, but a good compromise solution.


RE: Possible to do attack mode 6 and 7 on same attack - undeath - 12-20-2017

I remember only a0 supporting stdin mode. Not sure if this has changed.


RE: Possible to do attack mode 6 and 7 on same attack - walterlacka - 12-20-2017

(12-20-2017, 01:03 PM)undeath Wrote: I remember only a0 supporting stdin mode. Not sure if this has changed.

I think you're right:
Code:
./hashcat -O -w3 -a6 dict.txt ?a?a?a?a --stdout | ./hashcat -O -w3 -m0 -a7 ?a?a 'hash'

Gives:
Code:
Hash '?a?a': Line-length exception

No hashes loaded.

But this works:
Code:
./hashcat -O -w3 -a6 dict.txt ?a?a?a?a --stdout | ./hashcat -O -w3 -m0 -a0 'hash'

So, I was thinking I could create my own rule file using mp '^?a^?a' > new.rules, then issue this command:
Code:
./hashcat -O -w3 -a6 dict.txt ?a?a?a?a --stdout | ./hashcat -O -w3 -m0 -a0 'hash' -r ./new.rules 


But when I use this technique, my speed goes down dramatically.  Is there a way to implement this whole thing on GPU instead of using stdin?


RE: Possible to do attack mode 6 and 7 on same attack - royce - 12-20-2017

No - stdout leaves the hashcat process entirely, and there is no in-hashcat method for this today (other than, perhaps, generating a *very* large list of masks using maskprocessor:

Simplified PoC:

Code:
$ mp64 ?lhello?a | head
ahello
ahello!
ahello"
ahello#
ahello$
ahello%
ahello&
ahello'
ahello(
ahello)



RE: Possible to do attack mode 6 and 7 on same attack - walterlacka - 12-20-2017

The dict I want to use is only 2184 words… so I did this:
Code:
./hashcat -O -w3 -a7 ?a?a dict.txt --stdout > prependaa.txt

./maskprocessor-0.73/mp64.app '$?a$?a$?a$?a' > appendaaaa.rule


But that created 81450625 rules, and when running this command:

./hashcat -O -w3 -a0 ‘hash’ prependaa.txt -r ./appendaaaa.rule


I got this error:
Code:
* Device #2: Not enough allocatable device memory for this attack.


Then I tried with just device 3 and got the same error:
Code:
* Device #3: Not enough allocatable device memory for this attack.


So then I thought I would "reverse" the above by appending ?a?a?a?a to the end of the dictionary, and prepending the ?a?a to a rules file - which would give us less rules and I was hopeful I would have enough device memory at that point.  Problem with this is that the dict.txt file got WAY too big with the ?a?a?a?a at the end of it.

Any other ideas/suggestions?


RE: Possible to do attack mode 6 and 7 on same attack - royce - 12-25-2017

I think that you've got all of the possible pieces already, and you just need to arrange them with the trade-off that works best for you. It looks like appending or prepending ?a?a with rules as the final step is a good balance.