Skip to content

Commit

Permalink
Land #14382, update apply_pot to the hashcat generation
Browse files Browse the repository at this point in the history
  • Loading branch information
smcintyre-r7 committed Nov 11, 2020
2 parents 1fb7824 + cbc34d7 commit de4d8c0
Showing 1 changed file with 22 additions and 3 deletions.
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 !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

0 comments on commit de4d8c0

Please sign in to comment.