diff --git a/modules/exploits/linux/http/imperva_securesphere_exec.rb b/modules/exploits/linux/http/imperva_securesphere_exec.rb index e5216b345f..88e2dd3cda 100644 --- a/modules/exploits/linux/http/imperva_securesphere_exec.rb +++ b/modules/exploits/linux/http/imperva_securesphere_exec.rb @@ -98,8 +98,14 @@ class MetasploitModule < Msf::Exploit::Remote rescue Rex::ConnectionError, Errno::ENOTCONN => e fail_with(Failure::Unreachable, "#{peer} - Could not connect to the web service") end - if res && res.code == 401 - fail_with(Failure::NoAccess, 'Authorization Failure, valid agent registration credential is required') + if res + if res.code == 401 + fail_with(Failure::NoAccess, 'Authorization Failure, valid agent registration credential is required') + end + + unless res.code == 406 and res.body.include?("impctl") + fail_with(Failure::Unknown, 'Server did not respond in an expected way') + end end res end