File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
modules/auxiliary/scanner/http Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -96,21 +96,26 @@ def run
96
96
domain = nil
97
97
98
98
begin
99
- urls . each { |url |
99
+ urls . each do |url |
100
100
res = send_request_cgi ( {
101
101
'encode' => true ,
102
102
'uri' => "/#{ url } " ,
103
103
'method' => 'GET' ,
104
104
'headers' => { "Authorization" => "NTLM TlRMTVNTUAABAAAAB4IIogAAAAAAAAAAAAAAAAAAAAAGAbEdAAAADw==" }
105
105
} , 25 )
106
106
107
- if res . code == 401 and res [ 'WWW-Authenticate' ] . match ( /^NTLM/i )
107
+ if not res
108
+ print_error ( "#{ msg } HTTP Connection Error, Aborting" )
109
+ return :abort
110
+ end
111
+
112
+ if res and res . code == 401 and res [ 'WWW-Authenticate' ] . match ( /^NTLM/i )
108
113
hash = res [ 'WWW-Authenticate' ] . split ( 'NTLM ' ) [ 1 ]
109
114
domain = Rex ::Proto ::NTLM ::Message . parse ( Rex ::Text . decode_base64 ( hash ) ) [ :target_name ] . value ( ) . gsub ( /\0 / , '' )
110
115
print_good ( "Found target domain: " + domain )
111
116
break
112
117
end
113
- }
118
+ end
114
119
115
120
rescue ::Rex ::ConnectionError , Errno ::ECONNREFUSED , Errno ::ETIMEDOUT
116
121
print_error ( "#{ msg } HTTP Connection Failed, Aborting" )
You can’t perform that action at this time.
0 commit comments