-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy path2john
More file actions
59 lines (52 loc) · 1.94 KB
/
2john
File metadata and controls
59 lines (52 loc) · 1.94 KB
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
57
58
59
#!/bin/bash
# List the file"2John" options to pull a hash for cracking with John the Ripper
##CSI Cases Menu Script by CSI Linux v2021.1.23.1
##[email protected] - Jeremy Martin - infosecwriter
StartCase() {
printf "Enter the case name\n"
if [ -z "$1" ]
then
cases=$(zenity --entry --width=300 --title "Case Name" --text "Enter the case to add this to:" 2> >(grep -v 'GtkDialog' >&2))
else
cases=$1
echo "Adding to Case $cases"
fi
if [ -n "$cases" ]; then
if [ ! -d "~/Cases/$cases" ]; then
mkdir ~/Cases/$cases 2>/dev/null
cd ~/Cases/$cases
fi
/opt/csitools/case_env $cases 2>/dev/null
else
zenity --error --width=200 --text "No case entered, exiting" 2> >(grep -v 'GtkDialog' >&2)
exit
fi
}
StartCase "$1"
echo "Case=$cases"
cd /opt/john/run
find -L -name "*2john*" > options.txt
sed -i 's/.\///g' options.txt
cd ~/Cases
echo "in cases folder"
toojohn=$(zenity --entry --title "2John Hash Ripper" --text $(sort /opt/john/run/options.txt) --text "Pick the file type.")
echo "picked $toojohn"
tooapp=$(echo $toojohn | sed 's/.\///')
FILE=$(zenity --file-selection --title="Select a File")
case $? in
0)
echo "\"$FILE\" selected."
hashfile=$(basename "$FILE")
/opt/john/run/$tooapp $FILE > /home/csi/Cases/$cases/$hashfile.hash
echo "Hash $hashfile"
/opt/john/run/john /home/csi/Cases/$cases/$hashfile.hash && zenity --info --text="Calculation complete"
/opt/john/run/john --show /home/csi/Cases/$cases/$hashfile.hash >> /home/csi/Cases/$cases/Export/passwords.txt
echo "---" >> /home/csi/Cases/$cases/Export/passwords.txt
gedit /home/csi/Cases/$cases/Export/passwords.txt
echo "John cracking"
;;
1)
echo "No file selected.";;
-1)
echo "An unexpected error has occurred.";;
esac