Made a really simple nanorc file to highlight syntax in mask files if you open them in the nano text editor.
If you make a small mistake like ?? or dd it will highlight it in red.
Instructions
add your .nanorc file:
include "~/.nano/hcmask.nanorc"
command to include:
Code:
echo 'include "~/.nano/hcmask.nanorc"' >> ~/.nanorc
copy this code to ~/.nano/hcmask.nanorc
Code:
# nano syntax highlighting for hashcat hcmask files
syntax "hcmask" "\.hcmask"
# if you want to incluse *.masks add this behind the \.hcmask
# "|\.masks"
color brightblack "\?"
color brightwhite "u"
color yellow "d"
color brightcyan "a"
color brightblue "s"
color green "1"
color cyan "2"
color brightmagenta "3"
color brightyellow "4"
# gives warning
color brightred "\?\?"
color brightred "uu"
color brightred "dd"
color brightred "ss"
color brightred "ll"
color brightred "hh"
color brightred "HH"
color brightred "aa"
color brightred "bb"
If you only want the warnings use the lines below "# gives warning".
interesting. thanks for the contribution.
... but I think your syntax rules do not catch all cases see:
1.
https://hashcat.net/wiki/doku.php?id=mas...mask_files
2.
https://hashcat.net/wiki/doku.php?id=fre..._mask_file
for instance ?? is perfectly fine syntax: it means use the dollar AS-IS without interpreting it as a built-in or custom charset reference.
Furthermore, there is the \, and \# rule and we have these built-in charsets: ?l, ?u, ?d, ?h, ?H, ?s, ?a, ?b as you can see from the hashcat --help output
of course this can be easily improved (at least some of those missing syntax rules are quite easy to add to the rc file).
One thing that some users also do not understand is that ?a?abbbbb?a?a is a perfectly fine mask. It means that the string "bbbbb" is both prefixed and suffixed by 2 characters (?l?u?d?s). so we can have constant (hard-coded) strings within the mask too.
Thank you for your comment.
I don't understand "dollar AS-IS". From the hashcat output I see that you can use it as a question mark.
Code:
$ hashcat --stdout -a 3 ?????d
??1
??2
(...)
I'm aware that ?a?abbbbb?a?a is a valid mask. The syntax highlighting is very simple and has several shortcomings. Maybe I or someone else can improve it.
I had the problem that I sometimes didn't see mistakes like ?? when editing mask files, so this is a quick 'n dirty "hack".