hashcat Forum
Hashcat rule: Take first letter of each word in given word list - 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: Hashcat rule: Take first letter of each word in given word list (/thread-11186.html)



Hashcat rule: Take first letter of each word in given word list - matt99 - 12-11-2022

What is the correct syntax for a hashcat rule to take the first letter of each word of a given list? So let's say the content of my word list is
Code:
This is a word list
i like hashcat
A Text With Capital Letter

The output should be
Code:
Tiawl
ilh
ATWCL



RE: Hashcat rule: Take first letter of each word in given word list - DanielG - 12-12-2022

That's to complex for rules, you would need to pre-process your word list with something different. For example create something in a scripting language you are comfortable with (pyhton, powershell, etc).


RE: Hashcat rule: Take first letter of each word in given word list - viffju - 12-12-2022

awk works just fine on a Linux system:

Code:
$ cat wordlist.txt
This is a word list
i like hashcat
A Text With Capital Letter

Code:
$ awk '{for (i=1;i<=NF;i++) $i=substr($i,1,1)}1' OFS= wordlist.txt
Tiawl
ilh
ATWCL

or an easy, ugly, not that efficient alternative combining grep and sed:
Code:
$ grep -Eoz '\b.' wordlist.txt | sed -e 's/ //g'
Tiawl
ilh
ATWCL

you can pipe the output into hashcat or redirect it to a file to create a new word list:
Code:
$ awk '{for (i=1;i<=NF;i++) $i=substr($i,1,1)}1' OFS= wordlist.txt | hashcat ...
$ awk '{for (i=1;i<=NF;i++) $i=substr($i,1,1)}1' OFS= wordlist.txt  > wordlist.new