Module: Msf::Auxiliary::MultipleTargetHosts

Included in:
Scanner, Exploit::Remote::HttpServer::Relay, Exploit::Remote::SMB::RelayServer
Defined in:
lib/msf/core/auxiliary/multiple_target_hosts.rb

Overview

This module provides methods for modules which intend to handle multiple hosts themselves through some means, e.g. scanners. This circumvents the typical RHOSTS -> RHOST logic offered by the framework.

Instance Method Summary collapse

Instance Method Details

#checkObject



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/msf/core/auxiliary/multiple_target_hosts.rb', line 19

def check
  return Exploit::CheckCode::Unsupported unless has_check?

  nmod = replicant
  result = nmod.check_host(datastore['RHOST'])

  # Propagate the last_vuln_attempt (which may be the actual VulnAttempt
  # object) back from the replicant so that the ensure block in
  # job_run_proc (which calls report_failure on the *original* instance)
  # knows a vuln attempt was already created and can enrich it directly.
  if nmod.respond_to?(:last_vuln_attempt) && nmod.last_vuln_attempt && respond_to?(:last_vuln_attempt=)
    self.last_vuln_attempt = nmod.last_vuln_attempt
  end

  result
end

#has_check?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/msf/core/auxiliary/multiple_target_hosts.rb', line 15

def has_check?
  respond_to?(:check_host)
end