# # ronin-exploits - A Ruby library for ronin-rb that provides exploitation and # payload crafting functionality. # # Copyright (c) 2007-2023 Hal Brodigan (postmodern.mod3 at gmail.com) # # ronin-exploits is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published # by the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # ronin-exploits is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with ronin-exploits. If not, see . # require 'ronin/exploits/loot' module Ronin module Exploits module Mixins # # 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 # # @api public # # @since 1.0.0 # module Loot # The loot storage. # # @return [Ronin::Exploits::Loot] attr_reader :loot # # Initializes the exploit and {#loot} storage. # # @param [Hash{Symbol => Object}} kwargs # Additional keyword arguments for the exploit. # def initialize(**kwargs) super(**kwargs) @loot = Ronin::Exploits::Loot.new end end end end end