Class: Rex::Post::Meterpreter::Extensions::Stdapi::Fs::Dir

Inherits:
Dir
  • Object
show all
Defined in:
lib/rex/post/meterpreter/extensions/stdapi/fs/dir.rb

Overview

This class implements directory operations against the remote endpoint. It implements the Rex::Post::Dir interface.

Class Attribute Summary collapse

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Dir

chdir, delete, download, entries, entries_with_info, getwd, match, mkdir, pwd, rmdir, unlink, upload

Constructor Details

#initialize(path) ⇒ Dir

Initializes the directory instance.



34
35
36
37
# File 'lib/rex/post/meterpreter/extensions/stdapi/fs/dir.rb', line 34

def initialize(path)
  self.path   = path
  self.client = self.class.client
end

Class Attribute Details

.client ⇒ Object

Returns the value of attribute client.



22
23
24
# File 'lib/rex/post/meterpreter/extensions/stdapi/fs/dir.rb', line 22

def client
  @client
end

Instance Attribute Details

#client ⇒ Object (protected)

:nodoc:



397
398
399
# File 'lib/rex/post/meterpreter/extensions/stdapi/fs/dir.rb', line 397

def client
  @client
end

#path ⇒ Object

The path of the directory that was opened.



395
396
397
# File 'lib/rex/post/meterpreter/extensions/stdapi/fs/dir.rb', line 395

def path
  @path
end

Instance Method Details

#each(&block) ⇒ Object

Enumerates all of the contents of the directory.



48
49
50
# File 'lib/rex/post/meterpreter/extensions/stdapi/fs/dir.rb', line 48

def each(&block)
  client.fs.dir.foreach(self.path, &block)
end