Skip to content
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

update apply_pot to the hashcat generation #14382

Merged
merged 1 commit into from Nov 11, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 22 additions & 3 deletions modules/auxiliary/analyze/apply_pot.rb
Expand Up @@ -17,7 +17,13 @@ def initialize
help combine all the passwords into an easy to use format.
},
'Author' => ['h00die'],
'License' => MSF_LICENSE
'License' => MSF_LICENSE,
'Actions' =>
[
['john', 'Description' => 'Use John the Ripper'],
# ['hashcat', 'Description' => 'Use Hashcat'], # removed for simplicity
],
'DefaultAction' => 'john',
)
deregister_options('ITERATION_TIMEOUT')
deregister_options('CUSTOM_WORDLIST')
Expand Down Expand Up @@ -49,8 +55,20 @@ def initialize(db_hash, jtr_hash, username, id)
end
end

def show_run_command(cracker_instance)
return unless datastore['ShowCommand']
cmd = cracker_instance.show_command
print_status(" Cracking Command: #{cmd.join(' ')}")
end

def run
cracker = new_john_cracker
cracker = new_password_cracker
cracker.cracker = action.name
cracker_version = cracker.cracker_version
if action.name == 'john' and not cracker_version.include?'jumbo'
fail_with(Failure::BadConfig, 'John the Ripper JUMBO patch version required. See https://github.com/magnumripper/JohnTheRipper')
end
print_good("#{action.name} Version Detected: #{cracker_version}")

lookups = []

Expand Down Expand Up @@ -79,7 +97,8 @@ def run

print_status("Checking #{format} hashes against pot file")
cracker.format = format
cracker.each_cracked_password do |password_line|
show_run_command(cracker)
cracker.each_cracked_password.each do |password_line|
password_line.chomp!
next if password_line.blank? || password_line.nil?
fields = password_line.split(":")
Expand Down