meterpreter comm session implemented, untested
git-svn-id: file:///home/svn/incoming/trunk@2920 4d416f70-5f16-0410-b530-b9f4589650daunstable
parent
14e39004de
commit
6f6924e001
|
@ -6,7 +6,7 @@ X - meterpreter
|
|||
X - pivoting
|
||||
X - portfwd command
|
||||
- networking
|
||||
- switch board routing table for pivoting
|
||||
X - switch board routing table for pivoting
|
||||
- meterpreter 'comm' support
|
||||
- proxy 'comm' support
|
||||
- asm
|
||||
|
|
|
@ -21,6 +21,7 @@ class Meterpreter < Rex::Post::Meterpreter::Client
|
|||
#
|
||||
include Msf::Session
|
||||
include Msf::Session::Interactive
|
||||
include Msf::Session::Comm
|
||||
|
||||
def initialize(rstream)
|
||||
super
|
||||
|
@ -89,6 +90,27 @@ class Meterpreter < Rex::Post::Meterpreter::Client
|
|||
raise EOFError if (console.stopped? == true)
|
||||
end
|
||||
|
||||
|
||||
##
|
||||
#
|
||||
# Msf::Session::Comm implementors
|
||||
#
|
||||
##
|
||||
|
||||
#
|
||||
# Creates a connection based on the supplied parameters and returns it to
|
||||
# the caller. The connection is created relative to the remote machine on
|
||||
# which the meterpreter server instance is running.
|
||||
#
|
||||
def create(param)
|
||||
case param.proto
|
||||
when 'tcp'
|
||||
return net.socket.create(param)
|
||||
else
|
||||
raise Rex::UnsupportedProtocol.new(param.proto), caller
|
||||
end
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
attr_accessor :rstream, :console
|
||||
|
|
|
@ -46,6 +46,7 @@ module Session
|
|||
# Direct descendents
|
||||
require 'msf/core/session/interactive'
|
||||
require 'msf/core/session/basic'
|
||||
require 'msf/core/session/comm'
|
||||
|
||||
# Provider interfaces
|
||||
require 'msf/core/session/provider/single_command_execution'
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
require 'rex/socket'
|
||||
|
||||
module Msf
|
||||
module Session
|
||||
|
||||
###
|
||||
#
|
||||
# Comm
|
||||
# ----
|
||||
#
|
||||
# This class implements the Rex::Socket::Comm module interface and is capable
|
||||
# of creating network-based connections that are pivoted from the session in
|
||||
# question.
|
||||
#
|
||||
###
|
||||
module Comm
|
||||
include Rex::Socket::Comm
|
||||
|
||||
#
|
||||
# Session-based comm classes implement an instance specific method for
|
||||
# creating network-based connections rather than the typicall class
|
||||
# specific methods.
|
||||
#
|
||||
def create(param)
|
||||
raise NotImplementedError
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
|
@ -1,5 +1,6 @@
|
|||
require 'socket'
|
||||
require 'resolv'
|
||||
require 'rex/exceptions'
|
||||
|
||||
module Rex
|
||||
|
||||
|
@ -19,7 +20,10 @@ module Socket
|
|||
require 'rex/socket/parameters'
|
||||
require 'rex/socket/tcp'
|
||||
require 'rex/socket/tcp_server'
|
||||
|
||||
require 'rex/socket/comm'
|
||||
require 'rex/socket/comm/local'
|
||||
|
||||
require 'rex/socket/switch_board'
|
||||
|
||||
##
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
require 'rex/socket'
|
||||
|
||||
module Rex
|
||||
module Socket
|
||||
|
||||
###
|
||||
#
|
||||
# Comm
|
||||
# ----
|
||||
#
|
||||
# This mixin provides the basic interface that a derived class must implement
|
||||
# in order to be a compatible comm class.
|
||||
#
|
||||
###
|
||||
module Comm
|
||||
|
||||
#
|
||||
# Creates a compatible socket based on the supplied uniform parameters.
|
||||
#
|
||||
def self.create(param)
|
||||
raise NotImplementedError
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
|
@ -1,4 +1,3 @@
|
|||
require 'rex/exceptions'
|
||||
require 'rex/socket'
|
||||
require 'rex/socket/tcp'
|
||||
require 'rex/socket/ssl_tcp'
|
||||
|
@ -14,6 +13,8 @@ require 'rex/socket/udp'
|
|||
###
|
||||
class Rex::Socket::Comm::Local
|
||||
|
||||
include Rex::Socket::Comm
|
||||
|
||||
#
|
||||
# Creates an instance of a socket using the supplied parameters.
|
||||
#
|
||||
|
|
Loading…
Reference in New Issue