Skip to content

Instantly share code, notes, and snippets.

@singe
Created February 11, 2022 13:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save singe/8b94e8ebea69cb1eebc849a3e483f480 to your computer and use it in GitHub Desktop.
Save singe/8b94e8ebea69cb1eebc849a3e483f480 to your computer and use it in GitHub Desktop.
Hashcat Wordlist Stuff
#!/bin/bash
# Convert hashcat.pot to john.pot and merge them
# Usage: hc-to-john.sh <hashcat pot> <john pot>
# NB: Make sure the hashcat pot only contains 16
# and 32 character hashes that are LM and NT hashes
tmp1=$(mktemp -t pot-port)
tmp2=$(mktemp -t pot-port)
hashpot=$1
LC_ALL=UTF-8 sed 's/^\([a-f0-9]\{32\}:[^:]*\)$/$NT$\1/' $hashpot | grep '^\$NT\$' > $tmp1
LC_ALL=UTF-8 sed 's/^\([a-f0-9]\{16\}:[^:]*\)$/$LM$\1/' $hashpot | grep '^\$LM\$' >> $tmp1
johnpot=$2
curr=$(LC_ALL=UTF-8 wc -l $johnpot|tr -dc "[:digit:]")
echo Current John: $curr
LC_ALL=UTF-8 cat $johnpot $tmp1|LC_ALL=UTF-8 sort -u > $tmp2
cp $tmp2 $johnpot
tot=$(LC_ALL=UTF-8 wc -l $johnpot|tr -dc "[:digit:]")
echo New Total Unique: $tot
echo New uniques: $(($tot-$curr))
rm $tmp1
rm $tmp2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment