Files
metasploit-gs/lib/msf/core/exploit/sqli.rb
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

32 lines
1.2 KiB
Ruby
Raw Normal View History

module Msf
#
# This mixin provides helpers to perform SQL injection
# - provides a level of abstraction for common queries, for example, querying the table names
# - implements blind and time-based SQL injection in a reusable manner
# - Highly extendable (user can run any code to perform the requests, encode payloads and parse results)
#
2020-06-22 17:41:20 +02:00
module Exploit::SQLi
def initialize(info = {})
super
register_advanced_options(
[
OptFloat.new('SqliDelay', [ false, 'The delay to sleep on time-based blind SQL injections', 1.0 ])
2020-06-22 17:41:20 +02:00
]
)
end
2020-06-23 21:25:59 +02:00
#
# Creates an SQL injection object, this is the method module writers should use
# @param dbms [Class] The SQL injection class you intend to use
# @param opts [Hash] The options to use with this SQL injection
# @param query_proc [Proc] The proc that takes an SQL payload as a parameter, and queries the server
# @return [Object] an instance of dbms
#
def create_sqli(dbms:, opts: {}, &query_proc)
raise ArgumentError, 'Invalid dbms class' unless dbms.is_a?(Class) && dbms.ancestors.include?(Msf::Exploit::SQLi::Common)
2020-06-26 15:06:30 -05:00
dbms.new(datastore, framework, user_output, opts, &query_proc)
2020-06-23 21:25:59 +02:00
end
end
end