Module: Msf::Handler::ReverseTcpAllPorts

Includes:
ReverseTcp
Defined in:
lib/msf/core/handler/reverse_tcp_allports.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 Msf::Handler

#exploit_config, #parent_payload

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ReverseTcp

#cleanup_handler, #setup_handler, #start_handler, #stop_handler, #wrap_aes_socket

Methods included from Msf::Handler

#add_handler, #cleanup_handler, #handle_connection, #handler, #handler_name, #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'.


33
34
35
# File 'lib/msf/core/handler/reverse_tcp_allports.rb', line 33

def self.general_handler_type
  "reverse"
end

.handler_typeObject

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


25
26
27
# File 'lib/msf/core/handler/reverse_tcp_allports.rb', line 25

def self.handler_type
  return "reverse_tcp_allports"
end

Instance Method Details

#initialize(info = {}) ⇒ Object

Override the default port to be '1'


40
41
42
43
44
45
46
47
# File 'lib/msf/core/handler/reverse_tcp_allports.rb', line 40

def initialize(info = {})
  super

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