Module: Ronin::Script::ClassMethods

Defined in:
lib/ronin/script/script.rb

Overview

Since:

  • 1.1.0

Instance Method Summary collapse

Instance Method Details

#load_all(attributes = {}) ⇒ Object

Loads all objects with the matching attributes.

Parameters:

  • attributes (Hash) (defaults to: {})

    Attributes to search for.

Since:

  • 1.1.0



124
125
126
127
128
129
# File 'lib/ronin/script/script.rb', line 124

def load_all(attributes={})
  resources = all(attributes)
  resources.each { |resource| resource.load_script! }

  return resources
end

#load_first(attributes = {}) ⇒ Cacheable

Loads the first object with matching attributes.

Parameters:

  • attributes (Hash) (defaults to: {})

    Attributes to search for.

Returns:

  • (Cacheable)

    The loaded cached objects.

Since:

  • 1.1.0



144
145
146
147
148
149
150
# File 'lib/ronin/script/script.rb', line 144

def load_first(attributes={})
  if (resource = first(attributes))
    resource.load_script!
  end

  return resource
end

#load_from(path) ⇒ Script

Loads the Ronin::Script of the same class.

Examples:

Exploits::HTTP.load_from('mod_php_exploit.rb')
# => #<Ronin::Exploits::HTTP: ...>

Parameters:

  • path (String)

    The path to load the script from.

Returns:

  • (Script)

    The loaded script.

Since:

  • 1.1.0



110
111
112
# File 'lib/ronin/script/script.rb', line 110

def load_from(path)
  load_object(path)
end