Improve fail_with granularity for 400 error
Also corrects BadConfig to NoTarget in another one of my modules. Oops.bug/bundler_fix
parent
1a644cadc4
commit
b41427412b
|
@ -89,7 +89,7 @@ class MetasploitModule < Msf::Exploit
|
|||
target[:template]
|
||||
))
|
||||
rescue Errno::ENOENT
|
||||
fail_with(Failure::BadConfig, "Target has no #{t} support")
|
||||
fail_with(Failure::NoTarget, "Target has no #{t} support")
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -137,9 +137,13 @@ class MetasploitModule < Msf::Exploit::Remote
|
|||
)
|
||||
|
||||
if res.nil?
|
||||
fail_with(Failure::UnexpectedReply, 'Server returned nil response')
|
||||
fail_with(Failure::NotFound, 'Server returned nil response')
|
||||
elsif res && !res.redirect?
|
||||
fail_with(Failure::UnexpectedReply, "Server returned code #{res.code}")
|
||||
if res.code == 400 && res.headers['Server'].start_with?('Apache')
|
||||
fail_with(Failure::NotVulnerable, 'HttpProtocolOptions may be Strict')
|
||||
else
|
||||
fail_with(Failure::UnexpectedReply, "Server returned code #{res.code}")
|
||||
end
|
||||
end
|
||||
|
||||
res
|
||||
|
|
Loading…
Reference in New Issue