Path: blob/master/lib/msf/core/exploit/sqli.rb
19850 views
module Msf1#2# This mixin provides helpers to perform SQL injection3# - provides a level of abstraction for common queries, for example, querying the table names4# - implements blind and time-based SQL injection in a reusable manner5# - Highly extendable (user can run any code to perform the requests, encode payloads and parse results)6#7module Exploit::SQLi8def initialize(info = {})9super10register_advanced_options(11[12OptFloat.new('SqliDelay', [ false, 'The delay to sleep on time-based blind SQL injections', 1.0 ])13]14)15end1617#18# Creates an SQL injection object, this is the method module writers should use19# @param dbms [Class] The SQL injection class you intend to use20# @param opts [Hash] The options to use with this SQL injection21# @param query_proc [Proc] The proc that takes an SQL payload as a parameter, and queries the server22# @return [Object] an instance of dbms23#24def create_sqli(dbms:, opts: {}, &query_proc)25raise ArgumentError, 'Invalid dbms class' unless dbms.is_a?(Class) && dbms.ancestors.include?(Msf::Exploit::SQLi::Common)2627dbms.new(datastore, framework, user_output, opts, &query_proc)28end29end30end313233