2005-04-10 09:20:47 +00:00
|
|
|
#!/usr/bin/ruby
|
|
|
|
|
|
|
|
require 'Rex/Post/Meterpreter/Extension'
|
2005-04-11 01:59:45 +00:00
|
|
|
require 'Rex/Post/Meterpreter/Extensions/Stdapi/Dir'
|
2005-04-11 03:06:56 +00:00
|
|
|
require 'Rex/Post/Meterpreter/Extensions/Stdapi/FileStat'
|
2005-04-10 09:20:47 +00:00
|
|
|
require 'Rex/Post/Meterpreter/Extensions/Stdapi/Process'
|
2005-04-10 10:31:38 +00:00
|
|
|
require 'Rex/Post/Meterpreter/Extensions/Stdapi/Registry'
|
2005-04-10 09:20:47 +00:00
|
|
|
|
|
|
|
module Rex
|
|
|
|
module Post
|
|
|
|
module Meterpreter
|
|
|
|
module Extensions
|
|
|
|
module Stdapi
|
|
|
|
|
|
|
|
###
|
|
|
|
#
|
|
|
|
# Stdapi
|
|
|
|
# ------
|
|
|
|
#
|
|
|
|
# Standard ruby interface to remote entities
|
|
|
|
#
|
|
|
|
###
|
|
|
|
class Stdapi < Extension
|
|
|
|
def initialize(client)
|
|
|
|
super(client, 'stdapi')
|
2005-04-10 17:08:27 +00:00
|
|
|
|
|
|
|
# Alias the following things on the client object so that they
|
|
|
|
# can be directly referenced
|
2005-04-11 01:59:45 +00:00
|
|
|
client.register_extension_alias('dir', self.dir)
|
2005-04-11 03:06:56 +00:00
|
|
|
client.register_extension_alias('filestat', self.filestat)
|
2005-04-10 17:08:27 +00:00
|
|
|
client.register_extension_alias('process', self.process)
|
|
|
|
client.register_extension_alias('registry', self.registry)
|
2005-04-10 09:20:47 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def brand(klass)
|
|
|
|
klass = klass.dup
|
|
|
|
klass.client = self.client
|
|
|
|
return klass
|
|
|
|
end
|
|
|
|
|
2005-04-11 01:59:45 +00:00
|
|
|
def dir
|
|
|
|
brand(Rex::Post::Meterpreter::Extensions::Stdapi::Dir)
|
|
|
|
end
|
|
|
|
|
2005-04-11 03:06:56 +00:00
|
|
|
def filestat
|
|
|
|
brand(Rex::Post::Meterpreter::Extensions::Stdapi::FileStat)
|
|
|
|
end
|
|
|
|
|
2005-04-10 09:20:47 +00:00
|
|
|
def process
|
|
|
|
brand(Rex::Post::Meterpreter::Extensions::Stdapi::Process)
|
|
|
|
end
|
2005-04-10 10:31:38 +00:00
|
|
|
|
|
|
|
def registry
|
|
|
|
brand(Rex::Post::Meterpreter::Extensions::Stdapi::Registry)
|
|
|
|
end
|
2005-04-10 09:20:47 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
end; end; end; end; end
|