Module: Msf::Handler::ReverseTcpAllPorts

Includes:
ReverseTcp
Defined in:
lib/msf/core/handler/reverse_tcp_all_ports.rb

Overview

This module implements the reverse TCP handler that works with “allports” stagers. This handler listens on a single TCP port, and the operating system redirects all incoming connections on all ports to this listening port. This requires iptables or another packet filter to be used in order to work properly

Constant Summary

Constants included from Msf::Handler

Claimed, Unused

Instance Attribute Summary

Attributes included from ReverseTcp

#conn_threads, #handler_thread, #listener_sock, #listener_thread

Attributes included from Msf::Handler

#exploit_config, #parent_payload, #pending_connections, #session_waiter_event, #sessions

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ReverseTcp

#cleanup_handler, #comm_string, #human_name, #listener_uri, #payload_uri, #start_handler, #stop_handler, #wrap_aes_socket

Methods included from Msf::Handler::Reverse::Comm

#select_comm, #via_string

Methods included from Reverse

#bind_addresses, #bind_port, #is_loopback_address?, #setup_handler

Methods included from Msf::Handler

#add_handler, #cleanup_handler, #create_session, #handle_connection, #handler, #handler_name, #interrupt_wait_for_session, #register_session, #setup_handler, #start_handler, #stop_handler, #wait_for_session, #wfs_delay

Class Method Details

.general_handler_typeObject

Returns the connection-described general handler type, in this case ‘reverse’.



30
31
32
# File 'lib/msf/core/handler/reverse_tcp_all_ports.rb', line 30

def self.general_handler_type
  "reverse"
end

.handler_typeObject

Returns the string representation of the handler type, in this case ‘reverse_tcp_allports’.



22
23
24
# File 'lib/msf/core/handler/reverse_tcp_all_ports.rb', line 22

def self.handler_type
  return "reverse_tcp_allports"
end

Instance Method Details

#initialize(info = {}) ⇒ Object

Override the default port to be ‘1’



37
38
39
40
41
42
43
44
# File 'lib/msf/core/handler/reverse_tcp_all_ports.rb', line 37

def initialize(info = {})
  super

  register_options(
    [
      OptPort.new('LPORT', [true, 'The starting port number to connect back on', 1])
    ], Msf::Handler::ReverseTcpAllPorts)
end