Module: Ronin::Exploits::Mixins::Loot

Defined in:
lib/ronin/exploits/mixins/loot.rb

Overview

Adds the ability to store captured "loot" (ex: passwords, files, etc).

Examples

module Ronin
  module Exploits
    class MyExploit < Exploit

      include Mixins::Loot

      def launch
        # ...

        # add a file
        loot.add('foo.txt', captured_file)

        # add a file with a relative path
        loot.add('path/of/file', captured_file)

        # add JSON data
        loot.add('foo.json', data, format: :json)

        # add YAML data
        loot.add('foo.yaml', data, format: :yaml)

        # add CSV data
        loot.add('foo.csv',  data, format: :csv)
      end

    end
  end
end

Since:

  • 1.0.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#lootRonin::Exploits::Loot (readonly)

The loot storage.

Returns:

Since:

  • 1.0.0



69
70
71
# File 'lib/ronin/exploits/mixins/loot.rb', line 69

def loot
  @loot
end

Instance Method Details

#initialize(**kwargs) ⇒ Object

Initializes the exploit and #loot storage.

Parameters:

  • kwargs (Hash{Symbol => Object})

    Additional keyword arguments for the exploit.

Since:

  • 1.0.0



77
78
79
80
81
# File 'lib/ronin/exploits/mixins/loot.rb', line 77

def initialize(**kwargs)
  super(**kwargs)

  @loot = Ronin::Exploits::Loot.new
end