Last active
April 19, 2023 17:37
-
-
Save singe/b300fbeb9723b06cf882ddb1d66c9466 to your computer and use it in GitHub Desktop.
Convert clear passwords into slightly more generalised brute force masks for hashcat mode -a3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
file="$1" | |
tmp=$(mktemp) | |
# change specials & digits to hashcat format | |
sed -e "s/[[:punct:]]/?s/g" \ | |
-e "s/[[:digit:]]/?d/g" \ | |
$file \ | |
> $tmp \ | |
&& \ | |
# sort them most frequent to least and unique them | |
sort $tmp \ | |
| uniq -c \ | |
| sort -rn \ | |
| sed "s/^[\ 0-9]* //" \ | |
> $file.singemasks \ | |
&& rm $tmp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment