@@ -25,11 +25,11 @@ def initialize(info = {})
25
25
'Description' => %q{
26
26
Acronis Cyber Infrastructure (ACI) is an IT infrastructure solution that provides storage,
27
27
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
29
29
cloud-native applications in production environments.
30
30
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
33
33
to the appliance/server. This attack can be remotely executed over the WAN as long as the
34
34
PostgreSQL and SSH services are exposed to the outside world.
35
35
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 = {})
236
236
@timeout = true
237
237
end
238
238
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
246
259
end
247
- rescue Timeout ::Error
248
- return false
249
260
end
250
261
251
262
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 } " )
254
272
end
255
273
256
274
def exploit
0 commit comments