-
Notifications
You must be signed in to change notification settings - Fork 14.4k
Adds auto selection of cracker for password crackers #20418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
def getaction | ||
newaction = action.name | ||
if action.name == 'auto' | ||
path = Rex::FileUtils.find_full_path('hashcat') || | ||
Rex::FileUtils.find_full_path('hashcat.exe') | ||
if path | ||
newaction = 'hashcat' | ||
else | ||
path = Rex::FileUtils.find_full_path('john') || | ||
Rex::FileUtils.find_full_path('john.exe') | ||
if path | ||
newaction = 'john' | ||
else | ||
raise PasswordCrackerNotFoundError, 'No suitable john/hashcat binary was found on the system' | ||
end | ||
end | ||
end | ||
return newaction | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This just does exactly what is in cracker.rb
- I think we should keep the logic there and not move it separately into each module.
…ction Suggests additional changes for PR
@@ -25,8 +25,9 @@ def initialize | |||
'Actions' => [ | |||
['john', { 'Description' => 'Use John the Ripper' }], | |||
['hashcat', { 'Description' => 'Use Hashcat' }], | |||
['auto', { 'Description' => 'Auto-selection of cracker' ]} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
['auto', { 'Description' => 'Auto-selection of cracker' ]} | |
['auto', { 'Description' => 'Auto-selection of cracker' }] |
Co-authored-by: msutovsky-r7 <[email protected]>
Co-authored-by: msutovsky-r7 <[email protected]>
Release NotesUpdates the password cracking modules to now automatically detect the presence of JohnTheRipper or Hashcat binaries on the host filesystem when attempting to crack credentials. |
Description
The changes satisfy the requests made in issue number #20396.
The first change was made in the file “lib/metasploit/framework/password_crackers/cracker.rb”
to the “binary_path” function. In the issue, the user reported that if John The Ripper was not detected by Metasploit, it would not check if Hashcat was installed, so I modified the function so that there are four concatenated if statements rather than an if-elsif-else statement.
The second change is in “modules/auxiliary/analyze/” in the files:
They received the same change with the same implementation. I added an action, “auto.” If this action is used, the module will see if either Hashcat or John The Ripper is installed and will choose one of the two, preferring Hashcat.
Verification
msfconsole
use auxiliary/analyze/crack_databases
set action auto
creds add user:test_user postgres:md55d41402abc4b2a76b9719d911017c592
run