Class: SimpleClientPipe

Inherits:
Rex::Proto::SMB::SimpleClient show all
Defined in:
lib/msf/core/handler/bind_named_pipe.rb

Overview

SimpleClient for named pipe comms. Uses OpenPipe wrapper to provide a socket interface required by the packet dispatcher.

Constant Summary

Constants inherited from Rex::Proto::SMB::SimpleClient

Rex::Proto::SMB::SimpleClient::CONST, Rex::Proto::SMB::SimpleClient::CRYPT, Rex::Proto::SMB::SimpleClient::DEFAULT_VERSIONS, Rex::Proto::SMB::SimpleClient::EVADE, Rex::Proto::SMB::SimpleClient::UTILS, Rex::Proto::SMB::SimpleClient::XCEPT

Instance Attribute Summary collapse

Attributes inherited from Rex::Proto::SMB::SimpleClient

#address, #client, #direct, #last_error, #last_share, #port, #server_max_buffer_size, #shares, #socket, #versions

Instance Method Summary collapse

Methods inherited from Rex::Proto::SMB::SimpleClient

#connect, #delete, #disconnect, #login, #login_split_next_ntlm1, #login_split_start_ntlm1, #negotiated_smb_version, #open, #peerinfo, #peerport, #trans_pipe

Constructor Details

#initialize(socket, direct, versions = [1, 2, 3]) ⇒ SimpleClientPipe

Returns a new instance of SimpleClientPipe.



162
163
164
165
# File 'lib/msf/core/handler/bind_named_pipe.rb', line 162

def initialize(socket, direct, versions = [1, 2, 3])
  super(socket, direct, versions)
  self.pipe = nil
end

Instance Attribute Details

#pipeObject

Returns the value of attribute pipe.



160
161
162
# File 'lib/msf/core/handler/bind_named_pipe.rb', line 160

def pipe
  @pipe
end

Instance Method Details

#create_pipe(path) ⇒ Object

Copy of SimpleClient.create_pipe except OpenPipeSock is used instead of OpenPipe. This is because we need to implement our own read/write.



169
170
171
172
173
# File 'lib/msf/core/handler/bind_named_pipe.rb', line 169

def create_pipe(path)
  self.client.create_pipe(path)
  self.pipe = OpenPipeSock.new(self.client, path, self.client.last_tree_id, self.client.last_file_id, self.versions,
                               simple: self, server_max_buffer_size: self.server_max_buffer_size)
end