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/gather/browser_info.rb
Views: 11623
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Auxiliary6include Msf::Exploit::Remote::BrowserExploitServer78def initialize(info={})9super(update_info(info,10'Name' => "HTTP Client Information Gather",11'Description' => %q{12This module gathers information about a browser that exploits might be interested in, such13as OS name, browser version, plugins, etc. By default, the module will return a fake 404,14but you can customize this output by changing the Custom404 datastore option, and15redirect to an external web page.16},17'License' => MSF_LICENSE,18'Author' => [ 'sinn3r' ],19'DisclosureDate' => '2016-03-22',20'Actions' =>21[22[23'WebServer',24'Description' => 'A web server that collects information about the browser.'25]26],27'PassiveActions' => [ 'WebServer' ],28'DefaultAction' => 'WebServer'29))30end3132def is_key_wanted?(key)33![:module, :created_at, :tried, :vuln_test, :address].include?(key)34end3536def is_value_wanted?(value)37!(value.nil? || value =~ /^undefined|false/ || !value)38end3940def ignore_items!(target_info)41target_info.delete_if do |key, value|42!is_key_wanted?(key) || !is_value_wanted?(value)43end44end4546def report_host_info(target_info)47opts = { host: target_info[:address] }48opts.merge!(target_info)49report_host(opts)50end5152def translate_script_meaning(value)53case value54when 'script'55'Browser allows JavaScript'56when 'headers'57'Browser does not allow JavaScript'58end59end6061def print_target_info(cli, target_info)62print_good("#{cli.peerhost} - We have found the following interesting information:")63report_host_info(target_info)64ignore_items!(target_info)65target_info.each_pair do |key, value|66if key == :source67value = translate_script_meaning(value)68end69print_status("#{cli.peerhost} - #{key} = #{value}")70end71end7273def on_request_exploit(cli, req, target_info)74print_target_info(cli, target_info)75send_response(cli, '')76end7778def run79exploit80end81end828384