Class: Msf::Exploit::Remote

Inherits:
Msf::Exploit show all
Defined in:
lib/msf/core/exploit.rb

Overview

The remote exploit class is a specialization of the exploit module class that is geared toward exploits that are performed against targets other than the local machine. This typically implies exploiting other machines via a network connection, though it is not limited to this scope.

Defined Under Namespace

Modules: AFP, Arkeia, BrowserAutopwn, BrowserExploitServer, DB2, DCERPC, DCERPC_EPM, DCERPC_LSA, DCERPC_MGMT, Dialup, FirefoxAddonGenerator, FirefoxPrivilegeEscalation, Ftp, FtpServer, HttpClient, HttpServer, Imap, Ip, Ipv6, MSSQL, MSSQL_COMMANDS, MSSQL_SQLI, MYSQL, NDMP, Pop2, Postgres, RealPort, SMB, SMBServer, SMTPDeliver, SNMPClient, Smtp, SunRPC, TNS, Tcp, TcpServer, Telnet, Udp, VIMSoap, WDBRPC, WDBRPC_Client, Web, WinRM

Instance Attribute Summary

Attributes inherited from Msf::Exploit

#default_target, #fail_detail, #fail_reason, #payload, #payload_info, #payload_instance, #session_count, #successful, #targets

Attributes inherited from Module

#arch, #author, #datastore, #error, #job_id, #license, #module_store, #options, #platform, #privileged, #references, #uuid

Attributes included from Framework::Offspring

#framework

Attributes included from Rex::Ui::Subscriber::Input

#user_input

Attributes included from Rex::Ui::Subscriber::Output

#user_output

Instance Method Summary collapse

Methods inherited from Msf::Exploit

#add_handler, #aggressive?, #autofilter, #autofilter_ports, #autofilter_services, #capabilities, #cleanup, #compatible_encoders, #compatible_payloads, #encode_begin, #encode_end, #encode_shellcode_stub, #exploit, #fail_with, #generate_payload, #generate_single_payload, #handler, #handler_enabled?, #make_nops, mixins, #nop_generator, #nop_save_registers, #on_new_session, #passive?, #pattern_create, #payload_append, #payload_append_encoder, #payload_badchars, #payload_encoder_options, #payload_encoder_type, #payload_extended_options, #payload_max_nops, #payload_min_nops, #payload_prepend, #payload_prepend_encoder, #payload_space, #rand_char, #rand_text, #rand_text_alpha, #rand_text_alpha_lower, #rand_text_alpha_upper, #rand_text_alphanumeric, #rand_text_english, #rand_text_highascii, #rand_text_numeric, #regenerate_payload, #register_autofilter_ports, #register_autofilter_services, #report_failure, #reset_session_counts, #session_created?, #setup, #stack_adjustment, #stance, #supports_check?, #supports_exploit?, #target, #target_arch, #target_index, #target_platform, type, #type, #wfs_delay

Methods inherited from Module

#[], #[]=, #alias, #arch?, #arch_to_s, #author_to_s, #auxiliary?, cached?, #check, #comm, #compat, #compatible?, #debugging?, #description, #disclosure_date, #each_arch, #each_author, #encoder?, #exploit?, #fail_with, #file_path, #framework, #fullname, fullname, #import_defaults, is_usable, #name, #nop?, #orig_cls, #owner, #payload?, #platform?, #platform_to_s, #post?, #print_error, #print_good, #print_line, #print_line_prefix, #print_prefix, #print_status, #print_warning, #privileged?, rank, #rank, rank_to_h, #rank_to_h, rank_to_s, #rank_to_s, #refname, #register_parent, #replicant, #search_filter, #share_datastore, #shortname, shortname, #support_ipv6?, #target_host, #target_port, #type, type, #validate, #vprint_debug, #vprint_error, #vprint_good, #vprint_line, #vprint_status, #vprint_warning, #workspace

Methods included from Rex::Ui::Subscriber

#copy_ui, #init_ui, #reset_ui

Methods included from Rex::Ui::Subscriber::Input

#gets

Methods included from Rex::Ui::Subscriber::Output

#flush, #print, #print_debug, #print_error, #print_good, #print_line, #print_status, #print_warning

Constructor Details

#initialize(info) ⇒ Remote

Initializes the socket array.


169
170
171
172
173
# File 'lib/msf/core/exploit.rb', line 169

def initialize(info)
  super

  self.sockets = Array.new
end

Instance Method Details

#abort_socketsObject

This method is called once a new session has been created on behalf of this exploit instance and all socket connections created by this exploit should be closed.


201
202
203
204
205
206
207
208
209
210
# File 'lib/msf/core/exploit.rb', line 201

def abort_sockets
  sockets.delete_if { |sock|

    begin
      sock.close
    rescue ::Exception
    end
    true
  }
end

#add_socket(sock) ⇒ Object

Adds a socket to the list of sockets opened by this exploit.


185
186
187
# File 'lib/msf/core/exploit.rb', line 185

def add_socket(sock)
  self.sockets << sock
end

#exploit_typeObject

Returns the fact that this exploit is a remote exploit.


178
179
180
# File 'lib/msf/core/exploit.rb', line 178

def exploit_type
  Exploit::Type::Remote
end

#remove_socket(sock) ⇒ Object

Removes a socket from the list of sockets.


192
193
194
# File 'lib/msf/core/exploit.rb', line 192

def remove_socket(sock)
  self.sockets.delete(sock)
end