Permalink
Browse files

Merge branch 'bindaddress' of git://github.com/corelanc0d3r/metasploi…

…t-framework into corelanc0d3r-bindaddress
  • Loading branch information...
2 parents 1cb067e + 7733843 commit c0b214c287da773e4a7a8c3c781635ce1aa9c40e @sinn3r sinn3r committed Dec 13, 2012
Showing with 10 additions and 2 deletions.
  1. +10 −2 lib/msf/core/handler/reverse_http.rb
@@ -153,7 +153,8 @@ def initialize(info = {})
OptInt.new('SessionExpirationTimeout', [ false, 'The number of seconds before this session should be forcibly shut down', (24*3600*7)]),
OptInt.new('SessionCommunicationTimeout', [ false, 'The number of seconds of no activity before this session should be killed', 300]),
OptString.new('MeterpreterUserAgent', [ false, 'The user-agent that the payload should use for communication', 'Mozilla/4.0 (compatible; MSIE 6.1; Windows NT)' ]),
- OptString.new('MeterpreterServerName', [ false, 'The server header that the handler will send in response to requests', 'Apache' ])
+ OptString.new('MeterpreterServerName', [ false, 'The server header that the handler will send in response to requests', 'Apache' ]),
+ OptAddress.new('ReverseListenerBindAddress', [ false, 'The specific IP address to bind to on the local system'])
], Msf::Handler::ReverseHttp)
end
@@ -176,10 +177,17 @@ def setup_handler
comm = nil
end
+ # Determine where to bind the HTTP(S) server to
+ bindaddrs = ipv6 ? '::' : '0.0.0.0'
+
+ if not datastore['ReverseListenerBindAddress'].to_s.empty?
+ bindaddrs = datastore['ReverseListenerBindAddress']
+ end
+
# Start the HTTPS server service on this host/port
self.service = Rex::ServiceManager.start(Rex::Proto::Http::Server,
datastore['LPORT'].to_i,
- ipv6 ? '::' : '0.0.0.0',
+ bindaddrs,
ssl?,
{
'Msf' => framework,

0 comments on commit c0b214c

Please sign in to comment.