## # Does a simple HTTP get with the string supplied. # # joehancock - www.remoteroot.net ## require 'msf/core' module Msf class Auxiliary::HTTPGet < Msf::Auxiliary include Exploit::Remote::HttpClient def initialize super( 'Name' => 'Simple HTTP Get', 'Version' => '$ 0.1 $', 'Description' => 'Does a simple HTTP get or post with the supplied string.', 'Author' => 'Joe', 'Actions' => [ ['GET'], ['POST'] ], 'DefaultAction' => ['GET'] ) register_options( [ Opt::RPORT(80), Opt::RHOST(), OptString.new('URI', [true,'The URI to fetch.','index.html']) ], self.class) end def run print_status("Retrieving the URL with #{action.name}") target_uri = datastore['URI'] if(not target_uri) raise RuntimeError, "The URI option must be set" end case action.name when 'GET': method_action = 'GET' when 'POST': method_action = 'POST' end res = send_request_raw({ 'uri' => target_uri, 'method' => method_action }, 5) if (not res) print_status("No response from the server") return end if (res.code != 200) print_status("The server returned #{res.code} #{res.message}") return end print_good("Headers") print_line("#{res.headers}") print_good("Data") print_line("#{res.body}") end end end