Adding respond code/body check for successful command execution
parent
3aabeee959
commit
71aa4c8d9e
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue