metasploit-framework/lib/msf/core/handler/reverse.rb

35 lines
1018 B
Ruby
Raw Normal View History

2015-10-07 14:59:12 +00:00
module Msf
module Handler
2015-10-29 20:02:26 +00:00
# Options and methods needed for all handlers that listen for a connection
# from the payload.
2015-10-07 14:59:12 +00:00
module Reverse
autoload :Comm, 'msf/core/handler/reverse/comm'
autoload :SSL, 'msf/core/handler/reverse/ssl'
2015-10-29 20:02:26 +00:00
def initialize(info = {})
super
register_options(
[
Opt::LHOST,
Opt::LPORT(4444)
], Msf::Handler::Reverse)
register_advanced_options(
[
OptPort.new('ReverseListenerBindPort', [false, 'The port to bind to on the local system if different from LPORT']),
OptBool.new('ReverseAllowProxy', [ true, 'Allow reverse tcp even with Proxies specified. Connect back will NOT go through proxy but directly to LHOST', false]),
], Msf::Handler::Reverse
)
end
# @return [Integer]
def bind_port
port = datastore['ReverseListenerBindPort'].to_i
port > 0 ? port : datastore['LPORT'].to_i
end
2015-10-07 14:59:12 +00:00
end
end
end