Sha256: 7a391e09ce39374fc88915eb00d37e8c59bb6e131a562fcb32df4345b4af981c

Contents?: true

Size: 678 Bytes

Versions: 15

Compression:

Stored size: 678 Bytes

Contents

# -*- coding: binary -*-

module Rex

###
#
# This class provides an easy interface for loading and executing ruby
# scripts.
#
###
module Script

  class Completed < ::RuntimeError
  end

  #
  # Reads the contents of the supplied file and exeutes them.
  #
  def self.execute_file(file, in_binding = nil)
    str = ''
    buf = ::File.read(file, ::File.size(file))
    execute(buf, in_binding)
  end

  #
  # Executes arbitrary ruby from the supplied string.
  #
  def self.execute(str, in_binding = nil)
    begin
      eval(str, in_binding)
    rescue Completed
    end
  end

end

end

require 'rex/script/base'
require 'rex/script/shell'
require 'rex/script/meterpreter'

Version data entries

15 entries across 15 versions & 3 rubygems

Version Path
rex-2.0.13 lib/rex/script.rb
rex-2.0.12 lib/rex/script.rb
rex-2.0.11 lib/rex/script.rb
rex-2.0.10 lib/rex/script.rb
rex-2.0.9 lib/rex/script.rb
rex-2.0.8 lib/rex/script.rb
rex-2.0.7 lib/rex/script.rb
rex-2.0.5 lib/rex/script.rb
rex-2.0.4 lib/rex/script.rb
dstruct-0.0.1 lib/rex/script.rb
rex-2.0.3 lib/rex/script.rb
librex-0.0.999 lib/rex/script.rb
rex-2.0.2 lib/rex/script.rb
librex-0.0.71 lib/rex/script.rb
librex-0.0.70 lib/rex/script.rb