so quite simply I'm looking to incorporate the bcrpyt regex into an egrep command to see whether a bcrypt hash is present on each line.
I currently do this with MD5 hashes, quite easily:
egrep -wa "[a-f0-9]{32}" DB.txt >> DB_md5.txt
egrep -v -a "[a-f0-9]{32}" DB.txt >> DB_nomd5.txt
I've researched and found: Regular expression to find bcrypt hash?
Along with the solution being: \$2[ayb]\$.{56}
I'm struggling to include it in my egrep command. For example:
egrep -wa "\$2[ayb]\$.{56}" DB.txt >> DB_bcrypt.txt
The above command is not working. Any help is greatly appreciated.
Note: The position of the bcrypt hash is not important, it can be in any position on the line, hence why I've removed the ^ and $ from the regex solution found in the link below.