Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/modules/auxiliary/fuzzers/http/http_get_uri_strings.rb
Views: 11784
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Auxiliary6include Msf::Exploit::Remote::Tcp7include Msf::Auxiliary::Fuzzer89def initialize(info = {})10super(update_info(info,11'Name' => 'HTTP GET Request URI Fuzzer (Fuzzer Strings)',12'Description' => %q{13This module sends a series of HTTP GET request with malicious URIs.14},15'Author' => [ 'nullthreat' ],16'License' => MSF_LICENSE17))18register_options([19Opt::RPORT(80),20OptString.new("VHOST", [false, "The virtual host name to use in requests"]),21OptString.new("URIBASE", [true, "The base URL to use for the request fuzzer", "/"])22])23end2425def do_http_get(uri='',opts={})26@connected = false27connect28@connected = true2930sock.put("GET #{uri} HTTP/1.1\r\nHost: #{datastore['VHOST'] || rhost}\r\n\r\n")31sock.get_once(-1, opts[:timeout] || 0.01)32end3334def run35last_str = nil36last_inp = nil37last_err = nil3839pre = make_http_uri_base40cnt = 04142fuzz_strings do |str|43cnt += 14445# XXX: Encode the string or leave it raw? Best to make a new boolean option to enable/disable this46uri = pre + str4748if(cnt % 100 == 0)49print_status("Fuzzing with iteration #{cnt} using #{@last_fuzzer_input}")50end5152begin53r = do_http_get(uri,:timeout => 0.50)54rescue ::Interrupt55print_status("Exiting on interrupt: iteration #{cnt} using #{@last_fuzzer_input}")56raise $!57rescue ::Exception => e58last_err = e59ensure60disconnect61end6263if(not @connected)64if(last_str)65print_status("The service may have crashed: iteration:#{cnt-1} method=#{last_inp} uri=''#{last_str}'' error=#{last_err}")66else67print_status("Could not connect to the service: #{last_err}")68end69return70end7172last_str = str73last_inp = @last_fuzzer_input74end75end7677def make_http_uri_base78datastore['URIBASE']79end80end818283