Permalink
Browse files

Land #9897, Fix #8404 ListenerComm Support For Exploit::Remote::TcpSe…

…rver
  • Loading branch information...
busterb committed Sep 10, 2018
2 parents 0d774e1 + ebd1e01 commit a3d74d926cdcc96cecd8b21c284e4d3ddfbe35fe
@@ -83,7 +83,7 @@ def stop_service
if (service)
begin
self.service.deref if self.service.kind_of?(Rex::Service)
if self.service.kind_of?(Rex::Socket)
if self.service.kind_of?(Rex::Socket) || self.service.kind_of?(Rex::Post::Meterpreter::Channel)
self.service.close
self.service.stop
end
@@ -164,6 +164,20 @@ def _determine_server_comm(srv_comm = datastore['ListenerComm'].to_s)
comm
end
def via_string_for_ip(ip, comm)
comm_used = comm
comm_used ||= Rex::Socket::SwitchBoard.best_comm(ip)
comm_used ||= Rex::Socket::Comm::Local
if comm_used.respond_to?(:type) && comm_used.respond_to?(:sid)
via = "via the #{comm_used.type} on session #{comm_used.sid}"
else
via = ""
end
via
end
attr_accessor :service # :nodoc:
end
@@ -104,6 +104,10 @@ def start_service(*args)
end
raise e
end
via = via_string_for_ip(srvhost, comm)
hoststr = Rex::Socket.is_ipv6?(srvhost) ? "[#{srvhost}]" : srvhost
print_status("Started service listener on #{hoststr}:#{srvport} #{via}")
end
#
@@ -16,6 +16,8 @@ module SocketSubsystem
class TcpServerChannel < Rex::Post::Meterpreter::Channel
include Rex::IO::StreamServer
#
# This is a class variable to store all pending client tcp connections which have not been passed
# off via a call to the respective server tcp channels accept method. The dictionary key is the
@@ -87,7 +89,7 @@ def self.open(client, params)
end
#
# Simply initilize this instance.
# Simply initialize this instance.
#
def initialize(client, cid, type, flags)
super(client, cid, type, flags)
@@ -104,7 +106,7 @@ def accept_nonblock
end
#
# Accept a new tcp client connection form this tcp server channel. This method will block indefinatly
# Accept a new tcp client connection form this tcp server channel. This method will block indefinitely
# if no timeout is specified.
#
def accept(opts = {})
@@ -39,7 +39,6 @@ def setup
end
def run
print_status("Listening on #{datastore['SRVHOST']}:#{datastore['SRVPORT']}...")
exploit()
end
@@ -70,7 +70,6 @@ def run
@myautopwn = true
end
print_status("Listening on #{datastore['SRVHOST']}:#{datastore['SRVPORT']}...")
exploit()
end
@@ -51,7 +51,6 @@ def run
@myport = datastore['SRVPORT']
@realm = datastore['REALM']
print_status("Listening on #{datastore['SRVHOST']}:#{datastore['SRVPORT']}...")
exploit
end
@@ -37,7 +37,6 @@ def run
@client_cache = {}
# Starts Web Server
print_status("Listening on #{datastore['SRVHOST']}:#{datastore['SRVPORT']}...")
exploit
end
@@ -39,7 +39,6 @@ def setup
end
def run
print_status("Listening on #{datastore['SRVHOST']}:#{datastore['SRVPORT']}...")
exploit()
end
@@ -77,8 +77,6 @@ def run
@previous_lm_hash="none"
@previous_ntlm_hash="none"
print_status("Listening on #{datastore['SRVHOST']}:#{datastore['SRVPORT']}...")
exploit()
end
@@ -45,7 +45,6 @@ def run
return
end
@version = datastore['SRVVERSION']
print_status("Listening on #{datastore['SRVHOST']}:#{datastore['SRVPORT']}...")
exploit()
end
@@ -42,7 +42,6 @@ def setup
def run
@myhost = datastore['SRVHOST']
@myport = datastore['SRVPORT']
print_status("Listening on #{datastore['SRVHOST']}:#{datastore['SRVPORT']}...")
exploit()
end
@@ -35,7 +35,6 @@ def setup
end
def run
print_status("Listening on #{datastore['SRVHOST']}:#{datastore['SRVPORT']}...")
exploit()
end
@@ -40,7 +40,6 @@ def setup
end
def run
print_status("Listening on #{datastore['SRVHOST']}:#{datastore['SRVPORT']}...")
exploit()
end
@@ -42,7 +42,6 @@ def banner
end
def run
print_status("Listening on #{datastore['SRVHOST']}:#{datastore['SRVPORT']}...")
exploit()
end
@@ -41,7 +41,6 @@ def run
print_error("CHALLENGE syntax must match 00112233445566778899AABBCCDDEEFF")
return
end
print_status("Listening on #{datastore['SRVHOST']}:#{datastore['SRVPORT']}...")
exploit()
end

0 comments on commit a3d74d9

Please sign in to comment.