Nth instance of character
#1
Hello,

I've a problem with my syntax of nth instance of character.
This is my code :
hashcat -a 0 -m 0 hash.txt demonstration.dict -r test.rule --stdout

hash.txt containt MD5 hash of "pas$word"

demonstration.dict contain only one word : password

test.rule containt only this rule : %1s Dp ip$

I want to discover "pas$word" of hash. rule "ss$" replace all instance of 's' and give pa$$word.

nth instance of character rule is the solution with "%1s Dp ip$"

but when I execute : hashcat -a 0 -m 0 hash.txt demonstration.dict -r test.rule --stdout
I've got an error : No valid rules left

Any idea ? I use the last version 6.2.5
Thanks for reading and help me please.
Reply
#2
Your rule doesn't make any sense.

Written out with verbosity, the rule does the following:

%1s = "Reject plains which contain char "s" less than "1" time" This doesn't make sense because it's a reject rule that cant be applied with -r, and also will not do anything at all since password clear has more than 1 s.

Dp = "Delete character at position "p"" This doesn't make sense because "p" is 26 positions from the start, and "password" is only 8 characters long. This rule will not doing anything.

ip$ = "Insert character "$" at position "p"" This doesn't make sense because "p" is again, 26 positions from the start, so inserting a "$" there is impossible for an 8 character word. This will also not doing anything.

The rule is invalid due to the reject but also will not run regardless. It appears you may misunderstand how rules work so I would take a look here: https://hashcat.net/wiki/doku.php?id=rule_based_attack
There are plenty of footnotes and examples and even warnings on that page which would have cleared up these issues.
Reply
#3
Thank you.
I realized that I haven't understand some rule.
But I don't find solution about rule that make "pas$word" with "password"
Indeed, rule ss$ replace all instance and I want to change only first instance of "s"....
What is the solution ?
Thank you for helping
Reply