File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
modules/auxiliary/scanner/http Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -247,25 +247,26 @@ def get_ad_domain
247
247
'uri' => "/#{ url } " ,
248
248
'method' => 'GET' ,
249
249
'headers' => { "Authorization" => "NTLM TlRMTVNTUAABAAAAB4IIogAAAAAAAAAAAAAAAAAAAAAGAbEdAAAADw==" }
250
- } , 25 )
250
+ } )
251
251
252
252
if not res
253
253
print_error ( "#{ msg } HTTP Connection Error, Aborting" )
254
- return :abort
254
+ return nil
255
255
end
256
256
257
257
if res and res . code == 401 and res [ 'WWW-Authenticate' ] . match ( /^NTLM/i )
258
258
hash = res [ 'WWW-Authenticate' ] . split ( 'NTLM ' ) [ 1 ]
259
259
domain = Rex ::Proto ::NTLM ::Message . parse ( Rex ::Text . decode_base64 ( hash ) ) [ :target_name ] . value ( ) . gsub ( /\0 / , '' )
260
260
print_good ( "Found target domain: " + domain )
261
- break
261
+ return domain
262
262
end
263
263
end
264
264
265
265
rescue ::Rex ::ConnectionError , Errno ::ECONNREFUSED , Errno ::ETIMEDOUT
266
266
print_error ( "#{ msg } HTTP Connection Failed, Aborting" )
267
- return :abort
267
+ return nil
268
268
end
269
+
269
270
return domain
270
271
end
271
272
You can’t perform that action at this time.
0 commit comments