File tree Expand file tree Collapse file tree 1 file changed +16
-7
lines changed
lib/metasploit/framework/password_crackers Expand file tree Collapse file tree 1 file changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -300,24 +300,33 @@ def binary_path
300
300
if cracker_path && ::File . file? ( cracker_path )
301
301
return cracker_path
302
302
else
303
+ # Look in the Environment PATH for the hashcat binary
304
+ if cracker == 'hashcat'
305
+ path = Rex ::FileUtils . find_full_path ( 'hashcat' ) ||
306
+ Rex ::FileUtils . find_full_path ( 'hashcat.exe' )
307
+ end
308
+
303
309
# Look in the Environment PATH for the john binary
304
310
if cracker == 'john'
305
311
path = Rex ::FileUtils . find_full_path ( 'john' ) ||
306
- Rex ::FileUtils . find_full_path ( 'john.exe' )
307
- elsif cracker == 'hashcat'
308
- path = Rex :: FileUtils . find_full_path ( 'hashcat' ) ||
309
- Rex :: FileUtils . find_full_path ( 'hashcat.exe' )
310
- else
311
- raise PasswordCrackerNotFoundError , 'No suitable Cracker was selected, so a binary could not be found on the system'
312
+ Rex ::FileUtils . find_full_path ( 'john.exe' )
313
+ end
314
+
315
+ # If neither john nor hashcat is found, raise an error
316
+ if path == ''
317
+ raise PasswordCrackerNotFoundError , 'No suitable Cracker was selected, so a binary could not be found on the system JOHN || HASHCAT '
312
318
end
313
319
314
320
if path && ::File . file? ( path )
315
321
return path
316
322
end
317
323
318
- raise PasswordCrackerNotFoundError , 'No suitable john/hashcat binary was found on the system'
319
324
end
325
+
326
+ raise PasswordCrackerNotFoundError , 'No suitable john/hashcat binary was found on the system'
327
+
320
328
end
329
+
321
330
322
331
# This method runs the command from {#crack_command} and yields each line of output.
323
332
#
You can’t perform that action at this time.
0 commit comments