forked from kissthink/scripts
-
Notifications
You must be signed in to change notification settings - Fork 38
/
hlmcracker.sh
56 lines (43 loc) · 1.49 KB
/
hlmcracker.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
#Built for Kali
#
# This tool will use rcrack to perform the full cracking process of a Half LM Hash.
#
#
# Usage: ./hlmcrack.sh hlmhashes.txt
#
# Make sure to set the "hlmtable" variable to point to your hlm rainbow tables
#
# By: Leon Teale (RandomStorm)
#
#Set path to your half lm tables
hlmtable=/root/Desktop/wordlists/Rainbow_Tables/Halflmchall/
#Check usage
if [ -z "$1" ];
then
echo "Usage: ./hlmcrack.sh john_netntlm.txt"
else
for line in `cat $1 | sort -u`; do
echo "$line" > /tmp/newhash.txt
hash="$line"
username="`echo $line | cut -d : -f 1`"
seedhash="`echo $line | cut -d : -f 4 | sed 's/\(.\{16\}\).*/\1/'`"
#Get the seed (the first 16 digits of the hash)
/usr/bin/rcracki_mt -h $seedhash $hlmtable > /tmp/seed.tmp
seed=`cat /tmp/seed.tmp | grep "plaintext of" | awk {'print ($NF)'}`
#Crack the remaining hash
perl /usr/share/metasploit-framework/data/john/run.linux.x64.mmx/netntlm.pl --seed $seed --file /tmp/newhash.txt 1> /dev/null
perl /usr/share/metasploit-framework/data/john/run.linux.x64.mmx/netntlm.pl --file /tmp/newhash.txt | grep "($username)" 2> /dev/null >> /tmp/hlmcrack.txt
done
fi
#Printed Output
clear
echo "#################################################################################"
echo "Half LM cracked: cracked `cat /tmp/hlmcrack.txt | wc -l`\\`cat $1 | wc -l`"
echo ""
cat /tmp/hlmcrack.txt
echo ""
echo "#################################################################################"
rm /tmp/hlmcrack.txt
rm /tmp/newhash.txt
rm /tmp/seed.tmp