Path: blob/master/lib/msf/core/module/failure.rb
19515 views
# Constants indicating the reason for an unsuccessful module attempt1module Msf::Module::Failure2# The exploit settings were incorrect3BadConfig = 'bad-config'45# The network service disconnected us mid-attempt6Disconnected = 'disconnected'78# The application replied indication we do not have access9NoAccess = 'no-access'1011# No confidence in success or failure12None = 'none'1314# The target is not compatible with this exploit or settings15NoTarget = 'no-target'1617# The application endpoint or specific service was not found18NotFound = 'not-found'1920# The application response indicated it was not vulnerable21NotVulnerable = 'not-vulnerable'2223# The payload was delivered but no session was opened (AV, network, etc)24PayloadFailed = 'payload-failed'2526# The exploit triggered some form of timeout27TimeoutExpired = 'timeout-expired'2829# The application replied in an unexpected fashion30UnexpectedReply = 'unexpected-reply'3132# No confidence in success or failure33Unknown = 'unknown'3435# The network service was unreachable (connection refused, etc)36Unreachable = 'unreachable'3738# The exploit was interrupted by the user39UserInterrupt = 'user-interrupt'404142def report_failure43return unless framework.db and framework.db.active4445info = {46timestamp: Time.now.utc,47workspace: framework.db.find_workspace(self.workspace),48module: self.fullname,49fail_reason: self.fail_reason,50fail_detail: self.fail_detail,51username: self.owner,52refs: self.references,53run_id: self.datastore['RUN_ID']54}55info[:target_name] = self.target.name if self.respond_to?(:target)5657if self.datastore['RHOST'] && (self.options['RHOST'] || self.options['RHOSTS'])58info[:host] = self.datastore['RHOST']59end6061if self.datastore['RPORT'] and self.options['RPORT']62info[:port] = self.datastore['RPORT']63if self.class.ancestors.include?(Msf::Exploit::Remote::Tcp)64info[:proto] = 'tcp'65end66end6768framework.db.report_exploit_failure(info)69end7071end727374