@@ -86,18 +86,18 @@ def each
86
86
87
87
if username . present?
88
88
if password . present?
89
- yield Metasploit ::Framework ::Credential . new ( public : username , private : password , realm : realm )
89
+ yield Metasploit ::Framework ::Credential . new ( public : username , private : password , realm : realm , private_type : private_type ( password ) )
90
90
end
91
91
if user_as_pass
92
- yield Metasploit ::Framework ::Credential . new ( public : username , private : username , realm : realm )
92
+ yield Metasploit ::Framework ::Credential . new ( public : username , private : username , realm : realm , private_type : :password )
93
93
end
94
94
if blank_passwords
95
- yield Metasploit ::Framework ::Credential . new ( public : username , private : "" , realm : realm )
95
+ yield Metasploit ::Framework ::Credential . new ( public : username , private : "" , realm : realm , private_type : :password )
96
96
end
97
97
if pass_fd
98
98
pass_fd . each_line do |pass_from_file |
99
99
pass_from_file . chomp!
100
- yield Metasploit ::Framework ::Credential . new ( public : username , private : pass_from_file , realm : realm )
100
+ yield Metasploit ::Framework ::Credential . new ( public : username , private : pass_from_file , realm : realm , private_type : private_type ( pass_from_file ) )
101
101
end
102
102
pass_fd . seek ( 0 )
103
103
end
@@ -108,18 +108,18 @@ def each
108
108
user_fd . each_line do |user_from_file |
109
109
user_from_file . chomp!
110
110
if password
111
- yield Metasploit ::Framework ::Credential . new ( public : user_from_file , private : password , realm : realm )
111
+ yield Metasploit ::Framework ::Credential . new ( public : user_from_file , private : password , realm : realm , private_type : private_type ( password ) )
112
112
end
113
113
if user_as_pass
114
- yield Metasploit ::Framework ::Credential . new ( public : user_from_file , private : user_from_file , realm : realm )
114
+ yield Metasploit ::Framework ::Credential . new ( public : user_from_file , private : user_from_file , realm : realm , private_type : :password )
115
115
end
116
116
if blank_passwords
117
- yield Metasploit ::Framework ::Credential . new ( public : user_from_file , private : "" , realm : realm )
117
+ yield Metasploit ::Framework ::Credential . new ( public : user_from_file , private : "" , realm : realm , private_type : :password )
118
118
end
119
119
if pass_fd
120
120
pass_fd . each_line do |pass_from_file |
121
121
pass_from_file . chomp!
122
- yield Metasploit ::Framework ::Credential . new ( public : user_from_file , private : pass_from_file , realm : realm )
122
+ yield Metasploit ::Framework ::Credential . new ( public : user_from_file , private : pass_from_file , realm : realm , private_type : private_type ( pass_from_file ) )
123
123
end
124
124
pass_fd . seek ( 0 )
125
125
end
@@ -145,4 +145,14 @@ def each
145
145
pass_fd . close if pass_fd && !pass_fd . closed?
146
146
end
147
147
148
+ private
149
+
150
+ def private_type ( private )
151
+ if private =~ /[0-9a-f]{32}:[0-9a-f]{32}/
152
+ :ntlm_hash
153
+ else
154
+ :password
155
+ end
156
+ end
157
+
148
158
end
0 commit comments