initial File stub

git-svn-id: file:///home/svn/incoming/trunk@2364 4d416f70-5f16-0410-b530-b9f4589650da
unstable
Matt Miller 2005-04-11 03:37:02 +00:00
parent b81ebdc3f1
commit 91600f7d52
2 changed files with 39 additions and 0 deletions

View File

@ -0,0 +1,33 @@
#!/usr/bin/ruby
require 'Rex/Post/File'
require 'Rex/Post/Meterpreter/Extensions/Stdapi/Stdapi'
module Rex
module Post
module Meterpreter
module Extensions
module Stdapi
class File
include Rex::Post::File
class <<self
attr_accessor :client
end
def initialize(name, mode = "r", perms = 0)
self.client = self.class.client
end
def File.stat(name)
return client.filestat.new(name)
end
protected
attr_accessor :client
end
end; end; end; end; end

View File

@ -2,6 +2,7 @@
require 'Rex/Post/Meterpreter/Extension'
require 'Rex/Post/Meterpreter/Extensions/Stdapi/Dir'
require 'Rex/Post/Meterpreter/Extensions/Stdapi/File'
require 'Rex/Post/Meterpreter/Extensions/Stdapi/FileStat'
require 'Rex/Post/Meterpreter/Extensions/Stdapi/Process'
require 'Rex/Post/Meterpreter/Extensions/Stdapi/Registry'
@ -27,6 +28,7 @@ class Stdapi < Extension
# Alias the following things on the client object so that they
# can be directly referenced
client.register_extension_alias('dir', self.dir)
client.register_extension_alias('file', self.file)
client.register_extension_alias('filestat', self.filestat)
client.register_extension_alias('process', self.process)
client.register_extension_alias('registry', self.registry)
@ -42,6 +44,10 @@ class Stdapi < Extension
brand(Rex::Post::Meterpreter::Extensions::Stdapi::Dir)
end
def file
brand(Rex::Post::Meterpreter::Extensions::Stdapi::File)
end
def filestat
brand(Rex::Post::Meterpreter::Extensions::Stdapi::FileStat)
end