-
Notifications
You must be signed in to change notification settings - Fork 0
/
phoenix.sh
306 lines (237 loc) · 10.5 KB
/
phoenix.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
#!/bin/bash
RED1='\033[5;31m'
RED='\033[31m'
GREEN='\033[0;32m'
YELLOW='\033[0;33m'
YELLOW1='\033[5;33m'
BULE='\033[0;34m'
RESET='\033[0m'
wordlist="$4"
# Function to print banner
print_banner() {
echo ""
echo ""
echo -e "${RED}██████╗ ██╗ ██╗ ██████╗ ███████╗███╗ r ██╗██╗██╗ ██╗${RESET}"
echo -e "${RED}██╔══██╗██║ ██║██╔═══██╗██╔════╝████╗ ██║██║╚██╗██╔╝${RESET}"
echo -e "${RED}██████╔╝███████║██║ 3 ██║█████╗r ██╔██╗ ██║██║0╚███╔╝r${RESET}"
echo -e "${RED}██╔═══╝ ██╔══██║██║ ██║██╔══╝ ██║╚██╗██║██║ ██╔██╗ ${RESET}"
echo -e "${RED}██║ 4 ██║m ██║╚██████╔╝███████╗██║ ╚████║██║██╔╝ ██╗${RESET}"
echo -e "${RED}╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═══╝╚═╝╚═╝ ╚═╝${RESET}"
echo ""
echo ""
}
# Call the function to print the banner
print_banner
if [[ ${1} == "-h" ]] || [[ ${1} == "--help" ]]
then
echo "
Usage: ${0} [OPTIONS]
Options:
-h, --help Display this help menu
-v, --version Show script version
--hash HASH_TYPE Hash type (see supported types below)
-w, --wordlist WORDLIST Path to wordlist file
--crk hash Crack the specified hash
Supported hash types:
00 MD4
0 MD5
1 SHA1
2 SHA2-224
3 SHA2-256
4 SHA2-384
5 SHA2-512
6 SHA3-224
7 SHA3-256
8 SHA3-384
9 SHA3-512
10 RIPEMD-160
11 BLAKE2b-512
12 NTML
13 Whirlpool
Examples:
your_script.sh --hash 0 -w /path/to/wordlist.txt # Generate MD5 hashes from a wordlist
your_script.sh --crk hash -w wordlisthash.txt # crak the hash
your_script.sh -v # Show script version
your_script.sh --help # Show help menu
"
exit 1
elif [[ ${1} == "-v" ]] || [[ ${1} == "--version" ]]
then
echo -e "program version 1.0.0 "
elif [[ ${1} == "--hash" ]] && [[ ${2} == "0" ]] && [[ ${3} == "-w" ]] && [[ $wordlist == *.txt ]]
then
echo -e "${BULE}[+] Generating MD5 hashes for words in $wordlist...${RESET}"
echo -e "${YELLOW1}[+] Please wait${RESET}"
while read -r word; do
hash=$(echo -n "$word" | md5sum | awk '{print $1}')
echo "$word::$hash" >> "$wordlist.md5.txt"
done < "$wordlist"
echo -e "${GREEN}[+] Done! MD5 hashes saved to $wordlist.md5${RESET}"
#md5end
elif [[ ${1} == "--hash" ]] && [[ ${2} == "00" ]] && [[ ${3} == "-w" ]] && [[ $wordlist == *.txt ]]
then
echo -e "${BULE}[+]Generating MD4 hashes for words in $wordlist...${RESET}"
echo -e "${YELLOW1}[+] Please wait${RESET}"
while read -r word; do
hash=$(echo -n "$word" | openssl md4 | awk '{print $2}')
echo "$word::$hash" >> "$wordlist.md4.txt"
done < "$wordlist"
echo -e "${GREEN}[+]Done! MD4 hashes saved to $wordlist.md4${RESET}"
#md4end
elif [[ ${1} == "--hash" ]] && [[ ${2} == "1" ]] && [[ ${3} == "-w" ]] && [[ $wordlist == *.txt ]]
then
echo -e "${BULE}[+]Generating sha1 hashes for words in $wordlist...${RESET}"
echo -e "${YELLOW1}[+] Please wait${RESET}"
while read -r word; do
hash=$(echo -n "$word" | sha1sum | awk '{print $1}')
echo "$word::$hash" >> "$wordlist.sha1.txt"
done < "$wordlist"
echo -e "${GREEN}[+]Done! sha1 hashes saved to $output_file${RESET}"
#sha1end
elif [[ ${1} == "--hash" ]] && [[ ${2} == "2" ]] && [[ ${3} == "-w" ]] && [[ $wordlist == *.txt ]]
then
echo -e "${BULE}[+]Generating sha2-224 hashes for words in $wordlist...${RESET}"
echo -e "${YELLOW1}[+] Please wait${RESET}"
while read -r word; do
hash=$(echo -n "$word" | openssl sha224 | awk '{print $2}')
echo "$word::$hash" >> "$wordlist.sha2_224.txt"
done < "$wordlist"
echo -e "${GREEN}[+]Done! sha2_224 hashes saved to $wordlist.sha2_224${RESET}"
#sha2-224end
elif [[ ${1} == "--hash" ]] && [[ ${2} == "3" ]] && [[ ${3} == "-w" ]] && [[ $wordlist == *.txt ]]
then
echo -e "${BULE}[+]Generating sha2-256 hashes for words in $wordlist...${RESET}"
echo -e "${YELLOW1}[+] Please wait${RESET}"
while read -r word; do
hash=$(echo -n "$word" | openssl sha256 | awk '{print $2}')
echo "$word::$hash" >> "$wordlist.sha2_256.txt"
done < "$wordlist"
echo -e "${GREEN}[+]Done! sha2-256 hashes saved to $wordlist.sha2_256${RESET}"
#sha2-256end
elif [[ ${1} == "--hash" ]] && [[ ${2} == "4" ]] && [[ ${3} == "-w" ]] && [[ $wordlist == *.txt ]]
then
echo -e "${BULE}[+]Generating sha2-384 hashes for words in $wordlist...${RESET}"
echo -e "${YELLOW1}[+] Please wait${RESET}"
while read -r word; do
hash=$(echo -n "$word" | openssl sha384 | awk '{print $2}')
echo "$word::$hash" >> "$wordlist.sha2_384.txt"
done < "$wordlist"
echo -e "${GREEN}[+]Done! sha2-384 hashes saved to $wordlist.sha2_384 ${RESET}"
#sha2-384end
elif [[ ${1} == "--hash" ]] && [[ ${2} == "5" ]] && [[ ${3} == "-w" ]] && [[ $wordlist == *.txt ]]
then
echo -e "${BULE}[+]Generating sha2-512 hashes for words in $wordlist...${RESET}"
echo -e "${YELLOW1}[+] Please wait${RESET}"
while read -r word; do
hash=$(echo -n "$word" | openssl sha512 | awk '{print $2}')
echo "$word::$hash" >> "$wordlist.sha2_512.txt"
done < "$wordlist"
echo -e "${GREEN}[+]Done! sha2-512 hashes saved to $wordlist.sha2_512 ${RESET}"
#sha2-512end
elif [[ ${1} == "--hash" ]] && [[ ${2} == "6" ]] && [[ ${3} == "-w" ]] && [[ $wordlist == *.txt ]]
then
echo -e "${BULE}[+][+]Generating sha3-244 hashes for words in $wordlist...${RESET}"
echo -e "${YELLOW1}[+] Please wait${RESET}"
while read -r word; do
hash=$(echo -n "$word" | sha3sum -a 224 | awk '{print $1}')
echo "$word::$hash" >> "$wordlist.sha3_244.txt"
done < "$wordlist"
echo -e "${GREEN}[+] Done! sha3-244 hashes saved to $wordlist.sha3_244 ${RESET}"
#sha3-244end
elif [[ ${1} == "--hash" ]] && [[ ${2} == "7" ]] && [[ ${3} == "-w" ]] && [[ $wordlist == *.txt ]]
then
echo -e "${BULE}[+]Generating sha3-256 hashes for words in $wordlist...${RESET}"
echo -e "${YELLOW1}[+] Please wait${RESET}"
while read -r word; do
hash=$(echo -n "$word" | sha3sum -a 256 | awk '{print $1}')
echo "$word::$hash" >> "$wordlist.sha3_256.txt"
done < "$wordlist"
echo -e "${GREEN}[+] Done! sha3-256 hashes saved to $wordlist.sha3_256 ${RESET}"
#sha3-256end
elif [[ ${1} == "--hash" ]] && [[ ${2} == "8" ]] && [[ ${3} == "-w" ]] && [[ $wordlist == *.txt ]]
then
echo -e "${BULE}[+]Generating sha3-384 hashes for words in $wordlist...${RESET}"
echo -e "${YELLOW1}[+] Please wait${RESET}"
while read -r word; do
hash=$(echo -n "$word" | sha3sum -a 384 | awk '{print $1}')
echo "$word::$hash" >> "$wordlist.sha3_384.txt"
done < "$wordlist"
echo -e "${GREEN}[+] Done! sha3-384 hashes saved to $wordlist.sha3_384 ${RESET}"
#sha3-384end
elif [[ ${1} == "--hash" ]] && [[ ${2} == "9" ]] && [[ ${3} == "-w" ]] && [[ $wordlist == *.txt ]]
then
echo -e "${BULE}[+] Generating sha3-512 hashes for words in $wordlist... ${RESET}"
echo -e "${YELLOW1}[+] Please wait${RESET}"
while read -r word; do
hash=$(echo -n "$word" | sha3sum -a 512 | awk '{print $1}')
echo "$word::$hash" >> "$wordlist.sha3_512.txt"
done < "$wordlist"
echo -e "${GREEN}[+]Done! sha3-512 hashes saved to $wordlist.sha3_512 ${RESET}"
#sha3-512end
elif [[ ${1} == "--hash" ]] && [[ ${2} == "10" ]] && [[ ${3} == "-w" ]] && [[ $wordlist == *.txt ]]
then
echo -e "${BULE}[+]Generating ripemd160 hashes for words in $wordlist... ${RESET}"
echo -e "${YELLOW1}[+] Please wait${RESET}"
while read -r word; do
hash=$(echo -n "$word" | openssl ripemd160 | awk '{print $NF}')
echo "$word::$hash" >> "$wordlist.ripemd160.txt"
done < "$wordlist"
echo -e "${GREEN}[+]Done! ripemd160 hashes saved to $wordlist.ripemd160 ${RESET}"
#ripemd160end
elif [[ ${1} == "--hash" ]] && [[ ${2} == "11" ]] && [[ ${3} == "-w" ]] && [[ $wordlist == *.txt ]]
then
echo -e "${BULE}[+] Generating blake2b512 hashes for words in $wordlist... ${RESET}"
echo -e "${YELLOW1}[+] Please wait${RESET}"
while read -r word; do
hash=$(echo -n "$word" | openssl dgst -blake2b512 | awk '{print $NF}')
echo "$word::$hash" >> "$wordlist.blake2b512.txt"
done < "$wordlist"
echo -e "${GREEN}[+]Done! blake2b512 hashes saved to $wordlist.blake2b512 ${RESET}"
#blake2b512end
elif [[ ${1} == "--hash" ]] && [[ ${2} == "011" ]] && [[ ${3} == "-w" ]] && [[ $wordlist == *.txt ]]
then
echo -e "${BULE}[+]Generating blake2b512 hashes for words in $wordlist... ${RESET}"
echo -e "${YELLOW1}[+] Please wait${RESET}"
while read -r word; do
hash=$(echo -n "$word" | openssl dgst -blake2b512 | awk '{print $NF}')
echo "$word::$hash" >> "$wordlist.blake2b512.txt"
done < "$wordlist"
echo -e "${GREEN}[+]Done! blake2b512 hashes saved to $wordlist.blake2b512 ${RESET}"
#blake2b512end
elif [[ ${1} == "--hash" ]] && [[ ${2} == "12" ]] && [[ ${3} == "-w" ]] && [[ $wordlist == *.txt ]]
then
echo -e "${BULE}[+]Generating ntlm hashes for words in $wordlist...${RESET}"
echo -e "${YELLOW1}[+] Please wait${RESET}"
while read -r word; do
hash=$(echo -n "$word" | iconv -t utf16le | openssl md4 | awk '{print $NF}')
echo "$word::$hash" >> "$wordlist.ntml.txt"
done < "$wordlist"
echo -e "${GREEN}[+] Done! ntlm hashes saved to $wordlist.ntlm ${RESET}"
#ntlmend
elif [[ ${1} == "--hash" ]] && [[ ${2} == "13" ]] && [[ ${3} == "-w" ]] && [[ $wordlist == *.txt ]]
then
echo -e "${BULE}[+]Generating whirlpool hashes for words in $wordlist...${RESET}"
echo -e "${YELLOW1}[+] Please wait${RESET}"
while read -r word; do
hash=$(echo -n "$word" | openssl dgst -whirlpool | awk '{print $NF}')
echo "$word::$hash" >> "$wordlist.whirlpool.txt"
done < "$wordlist"
echo -e "${GREEN}[+]Done! whirlpool hashes saved to $wordlist.whirlpool ${RESET}"
#whirlpool
elif [[ ${1} == "--crk" ]] && [[ ${2} != "" ]] && [[ ${3} == "-w" ]] && [[ ${4} == *.txt ]]
then
# Grep the wordlist for a match with the hash
result=$(grep -i ${2} ${4})
# Check if a match was found
if [ -z "$result" ]; then
echo -e "${RED1}[+]No match found ${RESET}"
else
echo -e " ${GREEN}[+]Match found: $result ${RESET}"
fi
else
echo ""
echo -e "\033[31mError: Invalid option\033[0m"
echo ""
echo "Try '$0 -h or --help' for more information."
exit 1
fi