Determine comm from ReverseListenerComm in reverse_http

Also some copypasta from reverse_tcp to display where we started the
listener.
bug/bundler_fix
James Lee 2015-10-09 08:54:01 -05:00
parent 0132f9ce67
commit b16c284395
No known key found for this signature in database
GPG Key ID: 2D6094C7CEA0A321
1 changed files with 12 additions and 9 deletions

View File

@ -20,6 +20,7 @@ module ReverseHttp
include Msf::Handler include Msf::Handler
include Rex::Payloads::Meterpreter::UriChecksum include Rex::Payloads::Meterpreter::UriChecksum
include Msf::Payload::Windows::VerifySsl include Msf::Payload::Windows::VerifySsl
include Msf::Handler::Reverse::Comm
# #
# Returns the string representation of the handler type # Returns the string representation of the handler type
@ -129,16 +130,9 @@ module ReverseHttp
# #
def setup_handler def setup_handler
comm = datastore['ReverseListenerComm'] comm = select_comm
if (comm.to_s == 'local')
comm = ::Rex::Socket::Comm::Local
else
comm = nil
end
local_port = bind_port local_port = bind_port
# Start the HTTPS server service on this host/port # Start the HTTPS server service on this host/port
self.service = Rex::ServiceManager.start(Rex::Proto::Http::Server, self.service = Rex::ServiceManager.start(Rex::Proto::Http::Server,
local_port, local_port,
@ -164,7 +158,16 @@ module ReverseHttp
}, },
'VirtualDirectory' => true) 'VirtualDirectory' => true)
print_status("Started #{scheme.upcase} reverse handler on #{listener_uri}") comm_used = comm || Rex::Socket::SwitchBoard.best_comm( ip )
comm_used = Rex::Socket::Comm::Local if comm_used == nil
if( comm_used.respond_to?( :type ) and comm_used.respond_to?( :sid ) )
via = "via the #{comm_used.type} on session #{comm_used.sid}"
else
via = ""
end
print_status("Started #{scheme.upcase} reverse handler on #{listener_uri} #{via}")
lookup_proxy_settings lookup_proxy_settings
if datastore['IgnoreUnknownPayloads'] if datastore['IgnoreUnknownPayloads']