lib/rex/post/meterpreter/client_core.rb
def use(mod, opts = { })
    if (mod == nil)
      raise RuntimeError, "No modules were specified", caller
    end
    # Get us to the installation root and then into data/meterpreter, where
    # the file is expected to be
    modname = "ext_server_#{mod.downcase}"
    path = MeterpreterBinaries.path(modname, client.binary_suffix)

    if (opts['ExtensionPath'])
      path = opts['ExtensionPath']
    end

    path = ::File.expand_path(path)

    # Load the extension DLL
    commands = load_library(
        'LibraryFilePath' => path,
        'UploadLibrary'   => true,
        'Extension'       => true,
        'SaveToDisk'      => opts['LoadFromDisk'])
    client.add_extension(mod, commands)

    return true
  end
#
# Loads a meterpreter extension on the remote server instance and
# initializes the client-side extension handlers
#
#	Module
#		The module that should be loaded
#
#	LoadFromDisk
#		Indicates that the library should be loaded from disk, not from
#		memory on the remote machine
#
Loads a meterpreter extension on the remote server instance and
initializes the client-side extension handlers

Module
The module that should be loaded

LoadFromDisk
Indicates that the library should be loaded from disk, not from
memory on the remote machine
Loads a meterpreter extension on the remote server instance and initializes the client - side extension handlers Module The module that should be loaded LoadFromDisk Indicates that the library should be loaded from disk not from memory on the remote machine
def use(mod, opts = { })
    if (mod == nil)
      raise RuntimeError, "No modules were specified", caller
    end
    modname = "ext_server_#{mod.downcase}"
    path = MeterpreterBinaries.path(modname, client.binary_suffix)
    if (opts['ExtensionPath'])
      path = opts['ExtensionPath']
    end
    path = ::File.expand_path(path)
    commands = load_library(
        'LibraryFilePath' => path,
        'UploadLibrary'   => true,
        'Extension'       => true,
        'SaveToDisk'      => opts['LoadFromDisk'])
    client.add_extension(mod, commands)
    return true
  end
def use ( mod , opts = { } ) if ( mod == nil ) raise RuntimeError , "No modules were specified" , caller end modname = "ext_server_#{mod.downcase}" path = MeterpreterBinaries . path ( modname , client . binary_suffix ) if ( opts [ 'ExtensionPath' ] ) path = opts [ 'ExtensionPath' ] end path = :: File . expand_path ( path ) commands = load_library ( 'LibraryFilePath' => path , 'UploadLibrary' => true , 'Extension' => true , 'SaveToDisk' => opts [ 'LoadFromDisk' ] ) client . add_extension ( mod , commands ) return true end
Loads a meterpreter extension on the remote server instance and
initializes the client-side extension handlers
Loads a meterpreter extension on the remote server instance and initializes the client - side extension handlers
# Get us to the installation root and then into data/meterpreter, where # the file is expected to be # Load the extension DLL
mod
opts